Commit 9660aa97 authored by Benjamin Bellamy's avatar Benjamin Bellamy 💬 Committed by Yassine Doghri
Browse files

fix: reorder fields as composite primary keys for analytics tables

parent ed69b2f5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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()'
        );
+1 −1
Original line number Diff line number Diff line
@@ -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()'
+1 −1
Original line number Diff line number Diff line
@@ -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()'
        );
+1 −1
Original line number Diff line number Diff line
@@ -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()'
+1 −1
Original line number Diff line number Diff line
@@ -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()'
        );
Loading