simplify subscribing/unsubscribing podcasts
[mygpo.git] / install / update-37.sql
blobfdefbb222d59ee34e743ddabad16d6c9e1564509
1 CREATE TABLE `directory_entries` (
2     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
3     `podcast_id` integer,
4     `podcast_group_id` integer,
5     `tag` varchar(100) NOT NULL,
6     `ranking` double precision NOT NULL
9 ALTER TABLE `directory_entries` ADD CONSTRAINT `podcast_group_id_refs_id_78579aa5` FOREIGN KEY (`podcast_group_id`) REFERENCES `podcast_groups` (`id`);
10 ALTER TABLE `directory_entries` ADD CONSTRAINT `podcast_id_refs_id_189112b9` FOREIGN KEY (`podcast_id`) REFERENCES `podcast` (`id`);
13 create temporary table podcast_tags_tmp like podcast_tags;
14 insert into podcast_tags_tmp (select * from podcast_tags group by tag, podcast_id, source, user_id, weight);
15 delete from podcast_tags;
16 insert into podcast_tags (select * from podcast_tags_tmp);
19 create index podcast_id on directory_entries (podcast_id);
20 create index podcast_group_id on directory_entries (podcast_group_id);
21 create index tag on directory_entries (tag);
22 create index ranking on directory_entries (ranking);