fix: reorder fields as composite primary keys for analytics tables
This commit is contained in:
parent
ed69b2f500
commit
9660aa97c8
|
@ -41,7 +41,7 @@ class AddAnalyticsPodcastsByEpisode extends Migration
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$this->forge->addPrimaryKey(['podcast_id', 'episode_id', 'date']);
|
$this->forge->addPrimaryKey(['podcast_id', 'date', 'episode_id']);
|
||||||
$this->forge->addField(
|
$this->forge->addField(
|
||||||
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
||||||
);
|
);
|
||||||
|
|
|
@ -50,11 +50,11 @@ class AddAnalyticsPodcastsByPlayer extends Migration
|
||||||
]);
|
]);
|
||||||
$this->forge->addPrimaryKey([
|
$this->forge->addPrimaryKey([
|
||||||
'podcast_id',
|
'podcast_id',
|
||||||
|
'date',
|
||||||
'app',
|
'app',
|
||||||
'device',
|
'device',
|
||||||
'os',
|
'os',
|
||||||
'bot',
|
'bot',
|
||||||
'date',
|
|
||||||
]);
|
]);
|
||||||
$this->forge->addField(
|
$this->forge->addField(
|
||||||
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
||||||
|
|
|
@ -36,7 +36,7 @@ class AddAnalyticsPodcastsByCountry extends Migration
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$this->forge->addPrimaryKey(['podcast_id', 'country_code', 'date']);
|
$this->forge->addPrimaryKey(['podcast_id', 'date', 'country_code']);
|
||||||
$this->forge->addField(
|
$this->forge->addField(
|
||||||
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
||||||
);
|
);
|
||||||
|
|
|
@ -51,9 +51,9 @@ class AddAnalyticsPodcastsByRegion extends Migration
|
||||||
]);
|
]);
|
||||||
$this->forge->addPrimaryKey([
|
$this->forge->addPrimaryKey([
|
||||||
'podcast_id',
|
'podcast_id',
|
||||||
|
'date',
|
||||||
'country_code',
|
'country_code',
|
||||||
'region_code',
|
'region_code',
|
||||||
'date',
|
|
||||||
]);
|
]);
|
||||||
$this->forge->addField(
|
$this->forge->addField(
|
||||||
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
||||||
|
|
|
@ -36,7 +36,7 @@ class AddAnalyticsWebsiteByBrowser extends Migration
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$this->forge->addPrimaryKey(['podcast_id', 'browser', 'date']);
|
$this->forge->addPrimaryKey(['podcast_id', 'date', 'browser']);
|
||||||
$this->forge->addField(
|
$this->forge->addField(
|
||||||
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
||||||
);
|
);
|
||||||
|
|
|
@ -46,7 +46,7 @@ class AddAnalyticsWebsiteByReferer extends Migration
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$this->forge->addPrimaryKey(['podcast_id', 'referer', 'date']);
|
$this->forge->addPrimaryKey(['podcast_id', 'date', 'referer']);
|
||||||
$this->forge->addField(
|
$this->forge->addField(
|
||||||
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,7 +36,7 @@ class AddAnalyticsWebsiteByEntryPage extends Migration
|
||||||
'default' => 1,
|
'default' => 1,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$this->forge->addPrimaryKey(['podcast_id', 'entry_page', 'date']);
|
$this->forge->addPrimaryKey(['podcast_id', 'date', 'entry_page']);
|
||||||
$this->forge->addField(
|
$this->forge->addField(
|
||||||
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue