2021_05_11_084828_create_campaigns_table.php 1.81 KB
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCampaignsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('campaigns', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('token')->unsigned();
            $table->bigInteger('external_id')->unique();
            $table->string('name', 255)->nullable();
            $table->json('time_targeting')->nullable();
            $table->json('negative_keywords')->nullable();
            $table->json('blocked_ips')->nullable();
            $table->json('excluded_sites')->nullable();
            $table->json('daily_budget')->nullable();
            $table->json('bidding_strategy')->nullable();
            $table->json('settings')->nullable();
            $table->json('counter_ids')->nullable();
            $table->json('relevant_keywords')->nullable();
            $table->string('attribution_model', 4)->nullable();
            $table->json('priority_goals')->nullable();
            $table->timestamp('updated_self')->nullable();
            $table->timestamp('updated_children')->nullable();
            $table->boolean('manage')->default(0);
            $table->boolean('enabled')->default(1);
            $table->timestamp('groups_loaded_at')->nullable();
            $table->timestamp('keywords_loaded_at')->nullable();
            $table->timestamp('disabled_at')->nullable();
            $table->timestamps();

            $table->foreign('token')->references('id')->on('tokens');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('campaigns');
    }
}