2021_06_15_104738_create_advertisements_table.php
4.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
use App\Models\Advertisement;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAdvertisementsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('advertisements', function (Blueprint $table) {
$table->id();
$table->bigInteger('external_id')->nullable();
$table->bigInteger('campaign_external_id')->nullable();
$table->bigInteger('ad_group_external_id')->nullable();
$table->bigInteger('campaign_id')->unsigned();
$table->bigInteger('ad_group_id')->unsigned();
$table->enum('status', [
Advertisement::STATUS_ACCEPTED,
Advertisement::STATUS_DRAFT,
Advertisement::STATUS_MODERATION,
Advertisement::STATUS_PREACCEPTED,
Advertisement::STATUS_REJECTED,
Advertisement::STATUS_UNKNOWN,
])->nullable();
$table->enum('state', [
Advertisement::STATE_OFF,
Advertisement::STATE_ON,
Advertisement::STATE_SUSPENDED,
Advertisement::STATE_OFF_BY_MONITORING,
Advertisement::STATE_ARCHIVED,
Advertisement::STATE_UNKNOWN,
])->nullable();
$table->string('status_clarification')->nullable();
$table->json('ad_categories')->nullable();
$table->enum('age_label', [
Advertisement::AGE_LABEL_0,
Advertisement::AGE_LABEL_6,
Advertisement::AGE_LABEL_12,
Advertisement::AGE_LABEL_16,
Advertisement::AGE_LABEL_18,
Advertisement::AGE_LABEL_MONTHS_0,
Advertisement::AGE_LABEL_MONTHS_1,
Advertisement::AGE_LABEL_MONTHS_2,
Advertisement::AGE_LABEL_MONTHS_3,
Advertisement::AGE_LABEL_MONTHS_4,
Advertisement::AGE_LABEL_MONTHS_5,
Advertisement::AGE_LABEL_MONTHS_6,
Advertisement::AGE_LABEL_MONTHS_7,
Advertisement::AGE_LABEL_MONTHS_8,
Advertisement::AGE_LABEL_MONTHS_9,
Advertisement::AGE_LABEL_MONTHS_10,
Advertisement::AGE_LABEL_MONTHS_11,
Advertisement::AGE_LABEL_MONTHS_12,
])->nullable();
$table->enum('type', [
Advertisement::TYPE_TEXT_AD,
Advertisement::TYPE_MOBILE_APP_AD,
Advertisement::TYPE_DYNAMIC_TEXT_AD,
Advertisement::TYPE_IMAGE_AD,
Advertisement::TYPE_CPC_VIDEO_AD,
Advertisement::TYPE_CPM_BANNER_AD,
Advertisement::TYPE_CPM_VIDEO_AD,
Advertisement::TYPE_SMART_AD,
])->nullable();
$table->enum('sub_type', [
Advertisement::SUB_TYPE_NONE,
Advertisement::SUB_TYPE_TEXT_IMAGE_AD,
Advertisement::SUB_TYPE_MOBILE_APP_IMAGE_AD,
Advertisement::SUB_TYPE_MOBILE_APP_CPC_VIDEO_AD_BUILDER_AD,
Advertisement::SUB_TYPE_TEXT_AD_BUILDER_AD,
Advertisement::SUB_TYPE_MOBILE_APP_AD_BUILDER_AD,
])->nullable();
$table->string('title')->nullable();
$table->string('title2')->nullable();
$table->string('text')->nullable();
$table->string('href')->nullable();
$table->boolean('mobile')->nullable();
$table->string('display_domain')->nullable();
$table->string('display_url_path')->nullable();
$table->bigInteger('v_card_id')->nullable();
$table->string('ad_image_hash')->nullable();
$table->string('site_link_set_id')->nullable();
$table->json('display_url_path_moderation')->nullable();
$table->json('v_card_moderation')->nullable();
$table->json('site_links_moderation')->nullable();
$table->json('ad_image_moderation')->nullable();
$table->json('ad_extensions')->nullable();
$table->json('video_extension')->nullable();
$table->json('price_extension')->nullable();
$table->bigInteger('turbo_page_id')->nullable();
$table->bigInteger('turbo_page_moderation')->nullable();
$table->bigInteger('business_id')->nullable();
$table->boolean('prefer_v_card_over_business')->nullable();
$table->timestamp('updated_self')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('advertisements');
}
}