mirror of
https://code.castopod.org/adaures/castopod
synced 2025-04-19 13:01:19 +00:00
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,
|
||||
],
|
||||
]);
|
||||
$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()'
|
||||
);
|
||||
|
@ -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()'
|
||||
|
@ -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()'
|
||||
);
|
||||
|
@ -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()'
|
||||
|
@ -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()'
|
||||
);
|
||||
|
@ -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()'
|
||||
);
|
||||
|
@ -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()'
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user