From 9f4e5e8e7b4b068158234f0872cb5ed1bd78d1a6 Mon Sep 17 00:00:00 2001 From: Johnson Chetty Date: Wed, 22 Aug 2012 18:20:33 +0200 Subject: [PATCH] TheatreGroup model, template and getdict done. Major db change. db migration script added now --- migrations/sqldiff220812.sql | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 migrations/sqldiff220812.sql diff --git a/migrations/sqldiff220812.sql b/migrations/sqldiff220812.sql new file mode 100644 index 0000000..cb30106 --- /dev/null +++ b/migrations/sqldiff220812.sql @@ -0,0 +1,51 @@ + +-- Training + +CREATE TABLE `itfprofiles_theatregroup_trainings` ( + `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, + `theatregroup_id` integer NOT NULL, + `training_id` integer NOT NULL, + UNIQUE (`theatregroup_id`, `training_id`) +) +; +ALTER TABLE `itfprofiles_theatregroup_trainings` ADD CONSTRAINT `training_id_refs_id_b03d630f` FOREIGN KEY (`training_id`) REFERENCES `itfprofiles_training` (`id`); + + +-- Resource + +CREATE TABLE `itfprofiles_resource` ( + `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, + `title` varchar(255) NOT NULL, + `desc` longtext, + `fil` varchar(100), + `url` varchar(200), + `thumbnail` varchar(100) +) +; + +CREATE TABLE `itfprofiles_theatregroup_resources` ( + `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, + `theatregroup_id` integer NOT NULL, + `resource_id` integer NOT NULL, + UNIQUE (`theatregroup_id`, `resource_id`) +) +; +ALTER TABLE `itfprofiles_theatregroup_resources` ADD CONSTRAINT `theatregroup_id_refs_id_e38b9fdb` FOREIGN KEY (`theatregroup_id`) REFERENCES `itfprofiles_theatregroup` (`id`); + +ALTER TABLE `itfprofiles_theatregroup_resources` ADD CONSTRAINT `resource_id_refs_id_9b463807` FOREIGN KEY (`resource_id`) REFERENCES `itfprofiles_resource` (`id`); + + +-- Scriptbank. script added FK to Theatre group + +ALTER TABLE `scriptbank_script` ADD COLUMN `theatre_group_id` integer NOT NULL; + +ALTER TABLE `scriptbank_script` ADD CONSTRAINT `theatre_group_id_refs_id_ce3bf3b1` FOREIGN KEY (`theatre_group_id`) REFERENCES `itfprofiles_theatregroup` (`id`); + +-- misc + +CREATE INDEX `scriptbank_script_5b9aa168` ON `scriptbank_script` (`theatre_group_id`); +CREATE INDEX `itfprofiles_groupgroupoccupation_79ab4fb2` ON `itfprofiles_groupgroupoccupation` (`theatregroup_id`); +CREATE INDEX `itfprofiles_groupgroupoccupation_481bb443` ON `itfprofiles_groupgroupoccupation` (`groupoccupation_id`); +CREATE INDEX `itfprofiles_language_65da3d2c` ON `itfprofiles_language` (`code`); + +