Skip to content

Commit f2a06e0

Browse files
committed
Unique index names
1 parent 878d64e commit f2a06e0

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

database/migrations/2018_07_06_165603_add_indexes_for_tasks.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ class AddIndexesForTasks extends Migration
1414
public function up()
1515
{
1616
Schema::table(config('totem.table_prefix').'task_results', function (Blueprint $table) {
17-
$table->index('task_id', 'task_id_idx');
18-
$table->index('ran_at', 'ran_at_idx');
17+
$table->index('task_id', 'task_results_task_id_idx');
18+
$table->index('ran_at', 'task_results_ran_at_idx');
1919
$table->foreign('task_id', 'task_id_fk')
2020
->references('id')->on('tasks');
2121
});
2222

2323
Schema::table(config('totem.table_prefix').'task_frequencies', function (Blueprint $table) {
24-
$table->index('task_id', 'task_id_idx');
25-
$table->foreign('task_id', 'task_id_fk')
24+
$table->index('task_id', 'task_frequencies_task_id_idx');
25+
$table->foreign('task_id', 'task_frequencies_task_id_fk')
2626
->references('id')->on('tasks');
2727
});
2828

2929
Schema::table(config('totem.table_prefix').'tasks', function (Blueprint $table) {
30-
$table->index('is_active', 'is_active_idx');
31-
$table->index('dont_overlap', 'dont_overlap_idx');
32-
$table->index('run_in_maintenance', 'run_in_maintenance_idx');
33-
$table->index('run_on_one_server', 'run_on_one_server_idx');
34-
$table->index('auto_cleanup_num', 'auto_cleanup_num_idx');
35-
$table->index('auto_cleanup_type', 'auto_cleanup_type_idx');
30+
$table->index('is_active', 'tasks_is_active_idx');
31+
$table->index('dont_overlap', 'tasks_dont_overlap_idx');
32+
$table->index('run_in_maintenance', 'tasks_run_in_maintenance_idx');
33+
$table->index('run_on_one_server', 'tasks_run_on_one_server_idx');
34+
$table->index('auto_cleanup_num', 'tasks_auto_cleanup_num_idx');
35+
$table->index('auto_cleanup_type', 'tasks_auto_cleanup_type_idx');
3636
});
3737
}
3838

@@ -44,23 +44,23 @@ public function up()
4444
public function down()
4545
{
4646
Schema::table(config('totem.table_prefix').'task_results', function (Blueprint $table) {
47-
$table->dropIndex('task_id_idx');
48-
$table->dropIndex('ran_at_idx');
49-
$table->dropForeign('task_id_fk');
47+
$table->dropIndex('task_results_task_id_idx');
48+
$table->dropIndex('task_results_ran_at_idx');
49+
$table->dropForeign('task_results_task_id_fk');
5050
});
5151

5252
Schema::table(config('totem.table_prefix').'task_frequencies', function (Blueprint $table) {
53-
$table->dropIndex('task_id_idx');
54-
$table->dropForeign('task_id_fk');
53+
$table->dropIndex('task_frequencies_task_id_idx');
54+
$table->dropForeign('task_frequencies_task_id_fk');
5555
});
5656

5757
Schema::table(config('totem.table_prefix').'tasks', function (Blueprint $table) {
58-
$table->dropIndex('is_active_idx');
59-
$table->dropIndex('dont_overlap_idx');
60-
$table->dropIndex('run_in_maintenance_idx');
61-
$table->dropIndex('run_on_one_server_idx');
62-
$table->dropIndex('auto_cleanup_num_idx');
63-
$table->dropIndex('auto_cleanup_type_idx');
58+
$table->dropIndex('tasks_is_active_idx');
59+
$table->dropIndex('tasks_dont_overlap_idx');
60+
$table->dropIndex('tasks_run_in_maintenance_idx');
61+
$table->dropIndex('tasks_run_on_one_server_idx');
62+
$table->dropIndex('tasks_auto_cleanup_num_idx');
63+
$table->dropIndex('tasks_auto_cleanup_type_idx');
6464
});
6565
}
6666
}

0 commit comments

Comments
 (0)