Fix DB migrations to allow rollbacks

This commit is contained in:
Anand Capur
2017-08-23 12:34:34 -07:00
parent 3ee5803416
commit a73e71dd81
2 changed files with 4 additions and 2 deletions

View File

@@ -22,7 +22,9 @@ class SetAllocationUnqiueUsingMultipleFields extends Migration
public function down()
{
Schema::table('allocations', function (Blueprint $table) {
$table->dropForeign(['node_id']);
$table->dropUnique(['node_id', 'ip', 'port']);
$table->foreign('node_id')->references('id')->on('nodes');
});
}
}