diff --git a/database/migrations/2024_03_14_055537_remove_locations_table.php b/database/migrations/2024_03_14_055537_remove_locations_table.php index a6e74e8bb..bf41cd464 100644 --- a/database/migrations/2024_03_14_055537_remove_locations_table.php +++ b/database/migrations/2024_03_14_055537_remove_locations_table.php @@ -13,6 +13,7 @@ return new class extends Migration { Schema::table('nodes', function (Blueprint $table) { $table->dropForeign('nodes_location_id_foreign'); + $table->dropColumn('location_id'); }); Schema::drop('locations'); @@ -34,6 +35,11 @@ return new class extends Migration $table->timestamps(); }); + Schema::table('nodes', function (Blueprint $table) { + $table->unsignedInteger('location_id')->default(0); + $table->foreign('location_id')->references('id')->on('locations'); + }); + Schema::table('api_keys', function (Blueprint $table) { $table->unsignedTinyInteger('r_locations')->default(0); });