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/be.naniguide.com/database/migrations/2026_04_10_200007_create_ad_creatives_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_creatives', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('uid', 32)->unique();
            $table->integer('customer_id')->unsigned();
            $table->bigInteger('ad_campaign_id')->unsigned()->nullable();
            $table->string('name', 255);
            $table->string('type', 20);                               // image | video | carousel | html
            $table->string('headline', 255)->nullable();
            $table->text('primary_text')->nullable();
            $table->text('description')->nullable();
            $table->string('call_to_action', 30)->nullable();
            $table->string('destination_url', 2048)->nullable();
            $table->string('display_url', 255)->nullable();
            $table->string('image_url', 2048)->nullable();
            $table->string('video_url', 2048)->nullable();
            $table->longText('html_content')->nullable();
            $table->json('builder_content')->nullable();
            $table->string('thumbnail_url', 2048)->nullable();
            $table->json('carousel_cards')->nullable();
            $table->json('metadata')->nullable();
            $table->timestamps();

            $table->foreign('customer_id')->references('id')->on('customers')->onDelete('cascade');
            $table->index('customer_id', 'idx_adcreative_customer');
            $table->index('ad_campaign_id', 'idx_adcreative_campaign');
        });
    }

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