Skip to content

Commit 89db939

Browse files
committed
Fix broken migration rollbacks
1 parent 36837df commit 89db939

4 files changed

+7
-8
lines changed

database/migrations/2017_04_15_125021_UpgradeTaskSystem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public function up()
3636
public function down()
3737
{
3838
Schema::table('tasks', function (Blueprint $table) {
39-
$table->dropForeign(['server_id']);
40-
$table->dropForeign(['user_id']);
39+
// $table->dropForeign(['server_id']);
40+
// $table->dropForeign(['user_id']);
4141

4242
$table->renameColumn('server_id', 'server');
4343
$table->dropColumn('user_id');

database/migrations/2017_07_24_194433_DeleteTaskWhenParentServerIsDeleted.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public function up()
2323
*/
2424
public function down()
2525
{
26-
Schema::table('tasks', function (Blueprint $table) {
27-
$table->dropForeign(['server_id']);
28-
29-
$table->foreign('server_id')->references('id')->on('servers');
30-
});
26+
//
3127
}
3228
}

database/migrations/2018_01_11_213943_AddApiKeyPermissionColumns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function down()
4141
$table->unsignedInteger('key_id');
4242
$table->string('permission');
4343

44-
$table->foreign('key_id')->references('id')->on('keys')->onDelete('cascade');
44+
$table->foreign('key_id')->references('id')->on('api_keys')->onDelete('cascade');
4545
});
4646

4747
Schema::table('api_keys', function (Blueprint $table) {

database/migrations/2018_02_17_134254_ensure_unique_allocation_id_on_servers_table.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ public function up()
2626
public function down()
2727
{
2828
Schema::table('servers', function (Blueprint $table) {
29+
$table->dropForeign(['allocation_id']);
2930
$table->dropUnique(['allocation_id']);
31+
32+
$table->foreign('allocation_id')->references('id')->on('allocations');
3033
});
3134
}
3235
}

0 commit comments

Comments
 (0)