<?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('bydauto_contact', function (Blueprint $table) {
            $table->id();
            $table->timestamp('date_created');
            $table->timestamp('date_updated');
            $table->string('status')->nullable();
            $table->string('email')->nullable();
            $table->string('remark')->nullable();
        });

        Schema::create('bydauto_activity', function (Blueprint $table) {
            $table->id();
            $table->timestamp('date_created');
            $table->timestamp('date_updated');
            $table->string('status')->nullable();
            $table->string('name')->nullable();
            $table->string('content')->nullable();
            $table->unsignedBigInteger('related_id')->nullable();
            $table->string('related_type')->nullable();
        });

        Schema::create('bydauto_testdrive', function (Blueprint $table) {
            $table->id();
            $table->timestamp('date_created');
            $table->timestamp('date_updated');
            $table->string('status')->nullable();
            $table->string('name')->nullable();
            $table->string('mobile')->nullable();
            $table->string('platform')->nullable();
            $table->string('source')->nullable();
            $table->string('request_id')->nullable();
            $table->string('external_id')->nullable();
            $table->jsonb('meta')->nullable();
            $table->jsonb('rawdata')->nullable();
        });

        Schema::create('bydauto_promote_page', function (Blueprint $table) {
            $table->id();
            $table->string('page_id')->nullable();
            $table->string('name')->nullable();
            $table->string('type')->nullable();
            $table->string('property_list')->nullable();
        });
    }

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