Files
HexaHost-Panel/database/migrations/2026_05_15_000001_create_customers_table.php
2026-05-17 13:26:14 +02:00

35 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
{
public function up(): void
{
Schema::create('customers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('domain')->unique();
$table->unsignedInteger('vmid')->nullable()->unique();
$table->string('ip_address', 45)->nullable();
$table->unsignedTinyInteger('cpu')->default(2);
$table->unsignedInteger('ram')->default(2048);
$table->unsignedInteger('disk')->default(32);
$table->enum('status', ['pending', 'active', 'failed'])->default('pending');
$table->string('provisioning_step')->nullable();
$table->text('error_message')->nullable();
$table->timestamps();
$table->index('status');
$table->index('ip_address');
});
}
public function down(): void
{
Schema::dropIfExists('customers');
}
};