VPS and dedicated server ordering, managed panels, SSO, billing, and launcher integration — forked from hosting infrastructure with server-focused routes and dashboard. Co-authored-by: Cursor <cursoragent@cursor.com>
56 lines
2.3 KiB
PHP
56 lines
2.3 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
/**
|
|
* Registry of domains linked to hosting accounts (no website FK — hosting app
|
|
* does not own the site builder). Must run before hosting_orders.
|
|
*/
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('domains', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
|
|
$table->unsignedBigInteger('website_id')->nullable();
|
|
$table->unsignedBigInteger('hosting_account_id')->nullable();
|
|
$table->unsignedBigInteger('email_domain_id')->nullable();
|
|
$table->string('host')->unique();
|
|
$table->string('type')->default('custom');
|
|
$table->string('source')->default('hosting');
|
|
$table->string('onboarding_mode')->default('ns_auto');
|
|
$table->string('verification_token')->nullable();
|
|
$table->timestamp('verified_at')->nullable();
|
|
$table->string('status')->default('pending');
|
|
$table->string('ssl_status')->default('pending');
|
|
$table->string('onboarding_state')->default('pending_ns');
|
|
$table->string('dns_mode')->nullable();
|
|
$table->json('ns_expected')->nullable();
|
|
$table->json('ns_observed')->nullable();
|
|
$table->timestamp('ns_checked_at')->nullable();
|
|
$table->timestamp('connected_at')->nullable();
|
|
$table->timestamp('mail_ready_at')->nullable();
|
|
$table->timestamp('active_at')->nullable();
|
|
$table->timestamp('manual_dns_verified_at')->nullable();
|
|
$table->json('verification_meta')->nullable();
|
|
$table->timestamp('ssl_provisioned_at')->nullable();
|
|
$table->timestamp('ssl_expires_at')->nullable();
|
|
$table->string('registrar')->nullable();
|
|
$table->string('registrar_order_id')->nullable();
|
|
$table->timestamps();
|
|
|
|
$table->index(['user_id', 'host']);
|
|
$table->index(['source']);
|
|
$table->index(['hosting_account_id']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('domains');
|
|
}
|
|
};
|