From a33c0dfa953b66f296d9ec01fd73143814642ab7 Mon Sep 17 00:00:00 2001 From: idevakk <219866223+idevakk@users.noreply.github.com> Date: Thu, 27 Nov 2025 06:44:48 -0800 Subject: [PATCH] chore: optimized migration files for mariadb --- ..._11_14_120000_add_performance_indexes_to_tables.php | 10 +--------- .../2025_11_20_193234_create_plan_usages_table.php | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/database/migrations/2025_11_14_120000_add_performance_indexes_to_tables.php b/database/migrations/2025_11_14_120000_add_performance_indexes_to_tables.php index 3e9c0c9..5cdbe7e 100644 --- a/database/migrations/2025_11_14_120000_add_performance_indexes_to_tables.php +++ b/database/migrations/2025_11_14_120000_add_performance_indexes_to_tables.php @@ -97,10 +97,6 @@ return new class extends Migration $table->index(['is_activated', 'created_at'], 'activation_keys_activated_created_at_index'); }); - Schema::table('settings', function (Blueprint $table): void { - $table->index('key', 'settings_key_index'); - }); - Schema::table('metas', function (Blueprint $table): void { $table->index('key', 'metas_key_index'); }); @@ -197,12 +193,8 @@ return new class extends Migration $table->dropIndex('activation_keys_activated_created_at_index'); }); - Schema::table('settings', function (Blueprint $table): void { - $table->dropIndex('settings_key_index'); - }); - Schema::table('metas', function (Blueprint $table): void { $table->dropIndex('metas_key_index'); }); } -}; \ No newline at end of file +}; diff --git a/database/migrations/2025_11_20_193234_create_plan_usages_table.php b/database/migrations/2025_11_20_193234_create_plan_usages_table.php index 19e7e3d..7fb4195 100644 --- a/database/migrations/2025_11_20_193234_create_plan_usages_table.php +++ b/database/migrations/2025_11_20_193234_create_plan_usages_table.php @@ -23,7 +23,7 @@ return new class extends Migration $table->json('metadata')->nullable(); $table->timestamps(); - $table->unique(['user_id', 'plan_feature_id', 'usage_type', 'period_start']); + $table->unique(['user_id', 'plan_feature_id', 'usage_type', 'period_start'], 'plan_usage_unique'); $table->index(['user_id', 'period_start']); $table->index(['plan_feature_id', 'period_start']); });