fix: reorder fields as composite primary keys for analytics tables

This commit is contained in:
Benjamin Bellamy 2020-10-07 13:38:15 +02:00 committed by Yassine Doghri
parent ed69b2f500
commit 9660aa97c8
7 changed files with 7 additions and 7 deletions

View File

@ -41,7 +41,7 @@ class AddAnalyticsPodcastsByEpisode extends Migration
'default' => 1,
],
]);
$this->forge->addPrimaryKey(['podcast_id', 'episode_id', 'date']);
$this->forge->addPrimaryKey(['podcast_id', 'date', 'episode_id']);
$this->forge->addField(
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
);

View File

@ -50,11 +50,11 @@ class AddAnalyticsPodcastsByPlayer extends Migration
]);
$this->forge->addPrimaryKey([
'podcast_id',
'date',
'app',
'device',
'os',
'bot',
'date',
]);
$this->forge->addField(
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'

View File

@ -36,7 +36,7 @@ class AddAnalyticsPodcastsByCountry extends Migration
'default' => 1,
],
]);
$this->forge->addPrimaryKey(['podcast_id', 'country_code', 'date']);
$this->forge->addPrimaryKey(['podcast_id', 'date', 'country_code']);
$this->forge->addField(
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
);

View File

@ -51,9 +51,9 @@ class AddAnalyticsPodcastsByRegion extends Migration
]);
$this->forge->addPrimaryKey([
'podcast_id',
'date',
'country_code',
'region_code',
'date',
]);
$this->forge->addField(
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'

View File

@ -36,7 +36,7 @@ class AddAnalyticsWebsiteByBrowser extends Migration
'default' => 1,
],
]);
$this->forge->addPrimaryKey(['podcast_id', 'browser', 'date']);
$this->forge->addPrimaryKey(['podcast_id', 'date', 'browser']);
$this->forge->addField(
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
);

View File

@ -46,7 +46,7 @@ class AddAnalyticsWebsiteByReferer extends Migration
'default' => 1,
],
]);
$this->forge->addPrimaryKey(['podcast_id', 'referer', 'date']);
$this->forge->addPrimaryKey(['podcast_id', 'date', 'referer']);
$this->forge->addField(
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
);

View File

@ -36,7 +36,7 @@ class AddAnalyticsWebsiteByEntryPage extends Migration
'default' => 1,
],
]);
$this->forge->addPrimaryKey(['podcast_id', 'entry_page', 'date']);
$this->forge->addPrimaryKey(['podcast_id', 'date', 'entry_page']);
$this->forge->addField(
'`created_at` timestamp NOT NULL DEFAULT current_timestamp()'
);