From 320ecdecd3ae66815897f7edaad9060ed5cede8e Mon Sep 17 00:00:00 2001 From: Quentin Gabriele Date: Sun, 8 Sep 2024 21:42:52 +0200 Subject: [PATCH] add indexes --- database/migrations/add_type_column_to_invoices_table.php.stub | 2 +- database/migrations/create_invoices_table.php.stub | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/database/migrations/add_type_column_to_invoices_table.php.stub b/database/migrations/add_type_column_to_invoices_table.php.stub index 220181b..1c436c8 100644 --- a/database/migrations/add_type_column_to_invoices_table.php.stub +++ b/database/migrations/add_type_column_to_invoices_table.php.stub @@ -12,7 +12,7 @@ return new class extends Migration public function up(): void { Schema::table('invoices', function (Blueprint $table) { - $table->string('type')->default('invoice'); + $table->string('type')->default('invoice')->index(); $table->foreignId('parent_id')->nullable(); }); } diff --git a/database/migrations/create_invoices_table.php.stub b/database/migrations/create_invoices_table.php.stub index f1b46d9..ea886af 100644 --- a/database/migrations/create_invoices_table.php.stub +++ b/database/migrations/create_invoices_table.php.stub @@ -26,7 +26,7 @@ return new class extends Migration **/ $table->binary('logo')->nullable(); - $table->string('state'); + $table->string('state')->index(); $table->dateTime('state_set_at')->nullable(); $table->dateTime('due_at')->nullable();