Files
pterodactyl-panel/database/migrations/old/2017_03_18_204953_AddForeignKeyToPacks.php
T

31 lines
668 B
PHP
Raw Normal View History

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