Files
panel/database/migrations/2017_03_18_204953_AddForeignKeyToPacks.php

29 lines
621 B
PHP
Raw Normal View History

2017-03-18 20:52:02 -04:00
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
2024-03-19 21:03:50 -04:00
return new class extends Migration
2017-03-18 20:52:02 -04:00
{
/**
* Run the migrations.
*/
2024-03-19 21:12:27 -04:00
public function up(): void
2017-03-18 20:52:02 -04:00
{
Schema::table('servers', function (Blueprint $table) {
$table->foreign('pack_id')->references('id')->on('packs');
});
}
/**
* Reverse the migrations.
*/
2024-03-19 21:12:27 -04:00
public function down(): void
2017-03-18 20:52:02 -04:00
{
Schema::table('servers', function (Blueprint $table) {
$table->dropForeign(['pack_id']);
});
}
2024-03-19 21:03:50 -04:00
};