chore: optimized migration files for mariadb

This commit is contained in:
idevakk
2025-11-27 06:44:48 -08:00
parent 468409f0fc
commit a33c0dfa95
2 changed files with 2 additions and 10 deletions

View File

@@ -97,10 +97,6 @@ return new class extends Migration
$table->index(['is_activated', 'created_at'], 'activation_keys_activated_created_at_index'); $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 { Schema::table('metas', function (Blueprint $table): void {
$table->index('key', 'metas_key_index'); $table->index('key', 'metas_key_index');
}); });
@@ -197,12 +193,8 @@ return new class extends Migration
$table->dropIndex('activation_keys_activated_created_at_index'); $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 { Schema::table('metas', function (Blueprint $table): void {
$table->dropIndex('metas_key_index'); $table->dropIndex('metas_key_index');
}); });
} }
}; };

View File

@@ -23,7 +23,7 @@ return new class extends Migration
$table->json('metadata')->nullable(); $table->json('metadata')->nullable();
$table->timestamps(); $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(['user_id', 'period_start']);
$table->index(['plan_feature_id', 'period_start']); $table->index(['plan_feature_id', 'period_start']);
}); });