ctrlpanel/database/migrations/2021_02_07_173943_create_servers_table.php

41 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2021-06-05 09:26:32 +00:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2023-01-05 17:03:31 +00:00
return new class extends Migration
2021-06-05 09:26:32 +00:00
{
/**
* 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');
}
2023-01-05 17:03:31 +00:00
};