HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //home/xedaptot/ai.naniguide.com/database/migrations/2026_04_10_200002_create_ad_accounts_table.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('ad_accounts', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('uid', 32)->unique();
            $table->bigInteger('ad_platform_id')->unsigned();
            $table->string('remote_account_id', 255);
            $table->string('name', 255);
            $table->string('currency', 10)->default('USD');
            $table->string('timezone', 50)->nullable();
            $table->string('status', 20)->default('active');  // active | disabled | closed
            $table->boolean('is_default')->default(false);
            $table->json('metadata')->nullable();
            $table->timestamps();

            $table->foreign('ad_platform_id')->references('id')->on('ad_platforms')->onDelete('cascade');
            $table->index('ad_platform_id', 'idx_platform');
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('ad_accounts');
    }
};