Files
keystone/database/migrations/2025_03_27_120552_create_servers_table.php

43 lines
1.3 KiB
PHP

<?php
use App\Models\Network;
use App\Models\Organisation;
use App\Models\Provider;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('servers', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Organisation::class);
$table->foreignIdFor(Network::class, 'external_network_id');
$table->foreignIdFor(Network::class, 'internal_network_id')->nullable();
$table->foreignIdFor(Provider::class);
$table->string('external_id')->nullable();
$table->string('name');
$table->string('ipv4');
$table->string('ipv6');
$table->string('private_ip');
$table->string('provider_status');
$table->string('internal_ip');
$table->integer('internal_ip_ending');
$table->text('internal_public_key')->nullable();
$table->string('status');
$table->string('region');
$table->string('os');
$table->string('plan');
$table->string('user');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('servers');
}
};