ctrlpanel/database/migrations/2021_02_07_173943_create_servers_table.php
2023-01-05 17:03:31 +00:00

40 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servers', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->string('description')->nullable();
$table->dateTime('suspended')->nullable();
$table->string('identifier')->nullable();
$table->integer('pterodactyl_id')->nullable();
$table->foreignId('user_id')->references('id')->on('users');
$table->foreignId('egg_id')->references('id')->on('eggs');
$table->foreignId('location_id')->references('id')->on('locations');
$table->foreignUuid('product_id')->references('id')->on('products');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servers');
}
};