diff --git a/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php b/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php index 260af9a4..77b7f984 100644 --- a/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php +++ b/database/migrations/2017_08_05_144104_AllowNegativeValuesForOverallocation.php @@ -23,8 +23,8 @@ class AllowNegativeValuesForOverallocation extends Migration public function down() { Schema::table('nodes', function (Blueprint $table) { - $table->mediumInteger('disk_overallocate')->unsigned()->nullable()->change(); - $table->mediumInteger('memory_overallocate')->unsigned()->nullable()->change(); + DB::statement('ALTER TABLE nodes MODIFY disk_overallocate MEDIUMINT UNSIGNED NULL, + MODIFY memory_overallocate MEDIUMINT UNSIGNED NULL'); }); } } diff --git a/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php b/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php index ea1cb891..f7aab7c0 100644 --- a/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php +++ b/database/migrations/2017_08_05_174811_SetAllocationUnqiueUsingMultipleFields.php @@ -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'); }); } }