simplify subscribing/unsubscribing podcasts
[mygpo.git] / install / update-38.sql
blob8be6a953361ec8e19d0ca0421d16e1dd08e6ced0
1 alter table subscription add column settings text not null;
2 update subscription set settings = '{\"public_subscription\": true}' where public = True;
3 update subscription set settings = '{\"public_subscription\": false}' where public = False;
5 alter table user add column settings text not null;
6 update user set settings = '{\"public_profile\": true}' where public_profile = True;
7 update user set settings = '{\"public_profile\": false}' where public_profile = False;
9 alter table device add column settings text not null;
11 CREATE TABLE `episode_settings` (
12     `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
13     `user_id` integer NOT NULL,
14     `episode_id` integer NOT NULL,
15     `settings` longtext NOT NULL,
16     UNIQUE (`user_id`, `episode_id`)
19 ALTER TABLE `episode_settings` ADD CONSTRAINT `episode_id_refs_id_7347523a` FOREIGN KEY (`episode_id`) REFERENCES `episode` (`id`);
20 ALTER TABLE `episode_settings` ADD CONSTRAINT `user_id_refs_id_23924ff9` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`);