2 CREATE TABLE `historic_podcast_data` (
3 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
4 `podcast_id` integer NOT NULL,
6 `subscriber_count` integer NOT NULL,
7 UNIQUE (`podcast_id`, `date`)
10 ALTER TABLE `historic_podcast_data` ADD CONSTRAINT `podcast_id_refs_id_aeb8d2a` FOREIGN KEY (`podcast_id`) REFERENCES `podcast` (`id`);
11 CREATE TABLE `historic_episode_data` (
12 `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
13 `episode_id` integer NOT NULL,
15 `listener_count` integer NOT NULL,
16 UNIQUE (`episode_id`, `date`)
19 ALTER TABLE `historic_episode_data` ADD CONSTRAINT `episode_id_refs_id_2f31345e` FOREIGN KEY (`episode_id`) REFERENCES `episode` (`id`);
23 create index podcast_data_index on historic_podcast_data(podcast_id, date);
24 create index podcast_data_podcast_index on historic_podcast_data(podcast_id);
25 create index podcast_data_date_index on historic_podcast_data(date);
26 create index episode_data_index on historic_episode_data(episode_id, date);
27 create index episode_data_episode_index on historic_episode_data(episode_id);
28 create index episode_data_date_index on historic_episode_data(date);