CluPilotCloud/database/migrations/2026_07_25_090001_create_da...

27 lines
741 B
PHP

<?php
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('datacenters', function (Blueprint $table) {
$table->id();
$table->uuid('uuid')->unique();
$table->string('code')->unique(); // e.g. fsn, hel — used by hosts.datacenter + placement
$table->string('name');
$table->string('location')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('datacenters');
}
};