From f370de85264fb1b4d0c0e9d97b98958f8b59fb56 Mon Sep 17 00:00:00 2001 From: James Socol Date: Wed, 16 Feb 2011 15:08:12 -0500 Subject: [PATCH] Drop old migrations. [bug 634677] --- migrations/01-fix-table-engines.sql | 19 -- migrations/02-add-forum-description.sql | 10 - migrations/03-authority.sql | 22 -- migrations/04-users-permissions.sql | 14 - migrations/05-groups.sql | 25 -- migrations/06-admin-log.sql | 16 -- migrations/07-on-delete-set-null.sql | 2 - migrations/08-notifications.sql | 14 - migrations/09-add-updated-by.sql | 2 - migrations/10-create-questions-app.sql | 91 ------- migrations/11-drop-questionforum.sql | 3 - migrations/12-add-solution-id.sql | 2 - migrations/13-notification-hash.sql | 5 - migrations/14-add-question-votes.sql | 20 -- migrations/15-add-answer-votes.sql | 21 -- migrations/16-add-weekly-vote-count.sql | 4 - migrations/17-add-tagging.sql | 36 --- migrations/18-lock-question-permission.sql | 4 - migrations/19-flag-content.sql | 23 -- .../20-unique-metadata-question-and-name.sql | 2 - migrations/21-notification-event-type.sql | 10 - migrations/22-image-upload.sql | 17 -- migrations/23-aaq-confirmation-id.sql | 4 - migrations/24-add-os-tags.sql | 21 -- migrations/25-tiki-comments-metadata-id.sql | 31 --- migrations/26-index-tagged-object.sql | 3 - migrations/27-lock-tiki-forum.sql | 8 - .../28-flagit-moderation-permission.sql | 3 - migrations/29-orphaned-flags.sql | 44 ---- migrations/30-move-thread-permission.sql | 11 - .../31-restricted-forum-permissions.sql | 4 - migrations/32-customercare-tweets.sql | 12 - .../33-customercare-cannedresponses.sql | 27 -- migrations/34-customercare-acls.sql | 24 -- migrations/35-cannedresponses-initialdata.sql | 50 ---- migrations/36-answer-page.sql | 14 - migrations/37-wiki-app.sql | 60 ----- migrations/38-wiki-permissions.sql | 11 - migrations/39-document-slug.sql | 3 - migrations/40-remove-legacy-forum-types.sql | 9 - migrations/41-media-gallery.sql | 44 ---- .../42-notifications-object-id-optional.sql | 1 - migrations/43-review-revisions.sql | 4 - migrations/44-document-template.sql | 2 - migrations/45-gallery-video.sql | 6 - migrations/46-significance-optional.sql | 1 - migrations/47-notifications-locale.sql | 8 - migrations/48-add-approved-index.sql | 3 - migrations/49-video-unique.sql | 4 - migrations/50-kbforums.sql | 54 ---- migrations/51-document-is-localizable.sql | 2 - migrations/52-article-polls.sql | 16 -- migrations/53-fix-is-localizable.sql | 3 - migrations/54-wiki-metadata-unique.sql | 8 - migrations/55-latin1-tables.sql | 70 ----- migrations/56-filename-length-gallery.sql | 11 - migrations/57-related-documents.sql | 12 - migrations/58-kbforum-charsets.sql | 19 -- migrations/59-gallery-permissions.sql | 29 --- migrations/60-helpfulvote-charset.sql | 21 -- migrations/61-approvers.sql | 11 - migrations/62-customercare-replies.sql | 2 - migrations/63-migrate-tiki-passwords.sql | 2 - migrations/64-user-profile.sql | 17 -- migrations/65-registration-profile.sql | 6 - migrations/66-no-required-name.sql | 3 - migrations/67-redirects-unlocalizable.sql | 1 - migrations/68-live-chat-helpers.sql | 16 -- migrations/69-fix-table-engines.sql | 7 - migrations/70-drop-tiki-tables.sql | 241 ------------------ migrations/71-change-email.sql | 11 - migrations/72-video-poster.sql | 2 - migrations/73-wiki-document-visits.sql | 10 - migrations/74-remove-hashes.sql | 7 - migrations/75-localized-canned-responses.sql | 13 - migrations/76-inproduct-redirects.sql | 16 -- migrations/77-inproduct-bootstrap.sql | 38 --- migrations/78-new-notifications.sql | 29 --- migrations/79-shorten-notification-fields.sql | 9 - migrations/80-confirmed-watches.sql | 4 - migrations/81-based-on-for-translations.sql | 41 --- migrations/82-migrate-notifications.sql | 145 ----------- .../83-notifications-nullable-emails.sql | 6 - 83 files changed, 1656 deletions(-) delete mode 100644 migrations/01-fix-table-engines.sql delete mode 100644 migrations/02-add-forum-description.sql delete mode 100644 migrations/03-authority.sql delete mode 100644 migrations/04-users-permissions.sql delete mode 100644 migrations/05-groups.sql delete mode 100644 migrations/06-admin-log.sql delete mode 100644 migrations/07-on-delete-set-null.sql delete mode 100644 migrations/08-notifications.sql delete mode 100644 migrations/09-add-updated-by.sql delete mode 100644 migrations/10-create-questions-app.sql delete mode 100644 migrations/11-drop-questionforum.sql delete mode 100644 migrations/12-add-solution-id.sql delete mode 100644 migrations/13-notification-hash.sql delete mode 100644 migrations/14-add-question-votes.sql delete mode 100644 migrations/15-add-answer-votes.sql delete mode 100644 migrations/16-add-weekly-vote-count.sql delete mode 100644 migrations/17-add-tagging.sql delete mode 100644 migrations/18-lock-question-permission.sql delete mode 100644 migrations/19-flag-content.sql delete mode 100644 migrations/20-unique-metadata-question-and-name.sql delete mode 100644 migrations/21-notification-event-type.sql delete mode 100644 migrations/22-image-upload.sql delete mode 100644 migrations/23-aaq-confirmation-id.sql delete mode 100644 migrations/24-add-os-tags.sql delete mode 100644 migrations/25-tiki-comments-metadata-id.sql delete mode 100644 migrations/26-index-tagged-object.sql delete mode 100644 migrations/27-lock-tiki-forum.sql delete mode 100644 migrations/28-flagit-moderation-permission.sql delete mode 100644 migrations/29-orphaned-flags.sql delete mode 100644 migrations/30-move-thread-permission.sql delete mode 100644 migrations/31-restricted-forum-permissions.sql delete mode 100644 migrations/32-customercare-tweets.sql delete mode 100644 migrations/33-customercare-cannedresponses.sql delete mode 100644 migrations/34-customercare-acls.sql delete mode 100644 migrations/35-cannedresponses-initialdata.sql delete mode 100644 migrations/36-answer-page.sql delete mode 100644 migrations/37-wiki-app.sql delete mode 100644 migrations/38-wiki-permissions.sql delete mode 100644 migrations/39-document-slug.sql delete mode 100644 migrations/40-remove-legacy-forum-types.sql delete mode 100644 migrations/41-media-gallery.sql delete mode 100644 migrations/42-notifications-object-id-optional.sql delete mode 100644 migrations/43-review-revisions.sql delete mode 100644 migrations/44-document-template.sql delete mode 100644 migrations/45-gallery-video.sql delete mode 100644 migrations/46-significance-optional.sql delete mode 100644 migrations/47-notifications-locale.sql delete mode 100644 migrations/48-add-approved-index.sql delete mode 100644 migrations/49-video-unique.sql delete mode 100644 migrations/50-kbforums.sql delete mode 100644 migrations/51-document-is-localizable.sql delete mode 100644 migrations/52-article-polls.sql delete mode 100644 migrations/53-fix-is-localizable.sql delete mode 100644 migrations/54-wiki-metadata-unique.sql delete mode 100644 migrations/55-latin1-tables.sql delete mode 100644 migrations/56-filename-length-gallery.sql delete mode 100644 migrations/57-related-documents.sql delete mode 100644 migrations/58-kbforum-charsets.sql delete mode 100644 migrations/59-gallery-permissions.sql delete mode 100644 migrations/60-helpfulvote-charset.sql delete mode 100644 migrations/61-approvers.sql delete mode 100644 migrations/62-customercare-replies.sql delete mode 100644 migrations/63-migrate-tiki-passwords.sql delete mode 100644 migrations/64-user-profile.sql delete mode 100644 migrations/65-registration-profile.sql delete mode 100644 migrations/66-no-required-name.sql delete mode 100644 migrations/67-redirects-unlocalizable.sql delete mode 100644 migrations/68-live-chat-helpers.sql delete mode 100644 migrations/69-fix-table-engines.sql delete mode 100644 migrations/70-drop-tiki-tables.sql delete mode 100644 migrations/71-change-email.sql delete mode 100644 migrations/72-video-poster.sql delete mode 100644 migrations/73-wiki-document-visits.sql delete mode 100644 migrations/74-remove-hashes.sql delete mode 100644 migrations/75-localized-canned-responses.sql delete mode 100644 migrations/76-inproduct-redirects.sql delete mode 100644 migrations/77-inproduct-bootstrap.sql delete mode 100644 migrations/78-new-notifications.sql delete mode 100644 migrations/79-shorten-notification-fields.sql delete mode 100644 migrations/80-confirmed-watches.sql delete mode 100644 migrations/81-based-on-for-translations.sql delete mode 100644 migrations/82-migrate-notifications.sql delete mode 100644 migrations/83-notifications-nullable-emails.sql diff --git a/migrations/01-fix-table-engines.sql b/migrations/01-fix-table-engines.sql deleted file mode 100644 index 1b1570cfd..000000000 --- a/migrations/01-fix-table-engines.sql +++ /dev/null @@ -1,19 +0,0 @@ -BEGIN; - -ALTER TABLE django_content_type ENGINE=InnoDB; -ALTER TABLE django_session ENGINE=InnoDB; -ALTER TABLE django_site ENGINE=InnoDB; - -ALTER TABLE auth_group ENGINE=InnoDB; -ALTER TABLE auth_group_permissions ENGINE=InnoDB; -ALTER TABLE auth_message ENGINE=InnoDB; -ALTER TABLE auth_permission ENGINE=InnoDB; -ALTER TABLE auth_user ENGINE=InnoDB; -ALTER TABLE auth_user_groups ENGINE=InnoDB; -ALTER TABLE auth_user_user_permissions ENGINE=InnoDB; - -ALTER TABLE forums_forum ENGINE=InnoDB; -ALTER TABLE forums_thread ENGINE=InnoDB; -ALTER TABLE forums_post ENGINE=InnoDB; - -COMMIT; diff --git a/migrations/02-add-forum-description.sql b/migrations/02-add-forum-description.sql deleted file mode 100644 index 6f30a7931..000000000 --- a/migrations/02-add-forum-description.sql +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN; --- Application: forums --- Model: Forum -ALTER TABLE `forums_forum` - ADD `description` longtext; -ALTER TABLE `forums_forum` - ADD `last_post_id` integer; -CREATE INDEX `forums_forum_last_post_id_idx` - ON `forums_forum` (`last_post_id`); -COMMIT; diff --git a/migrations/03-authority.sql b/migrations/03-authority.sql deleted file mode 100644 index cf7094056..000000000 --- a/migrations/03-authority.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE `authority_permission` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `codename` varchar(100) COLLATE utf8_unicode_ci NOT NULL, - `content_type_id` int(11) NOT NULL, - `object_id` int(10) unsigned NOT NULL, - `user_id` int(11) DEFAULT NULL, - `group_id` int(11) DEFAULT NULL, - `creator_id` int(11) DEFAULT NULL, - `approved` tinyint(1) NOT NULL, - `date_requested` datetime NOT NULL, - `date_approved` datetime DEFAULT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `codename` (`codename`,`object_id`,`content_type_id`,`user_id`,`group_id`), - KEY `authority_permission_content_type_id` (`content_type_id`), - KEY `authority_permission_user_id` (`user_id`), - KEY `authority_permission_group_id` (`group_id`), - KEY `authority_permission_creator_id` (`creator_id`), - CONSTRAINT `content_type_id_refs_id_3a7e97c5` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), - CONSTRAINT `creator_id_refs_id_112fc87` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `group_id_refs_id_d3ca3118` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), - CONSTRAINT `user_id_refs_id_112fc87` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/migrations/04-users-permissions.sql b/migrations/04-users-permissions.sql deleted file mode 100644 index 94db6a1ed..000000000 --- a/migrations/04-users-permissions.sql +++ /dev/null @@ -1,14 +0,0 @@ --- Migrate the users first -INSERT IGNORE INTO auth_user (id, username, first_name, last_name, - email, password, is_staff, is_active, - is_superuser, last_login, date_joined) - SELECT users_users.userId, users_users.login, '', '', - users_users.email, '', 0, 1, 0, - FROM_UNIXTIME(users_users.registrationDate), - FROM_UNIXTIME(users_users.registrationDate) - FROM users_users; - -INSERT INTO auth_group (id, name) - VALUES (1, 'Forum Moderators'); - -UPDATE auth_user SET password = ''; diff --git a/migrations/05-groups.sql b/migrations/05-groups.sql deleted file mode 100644 index 8ff5fcc6b..000000000 --- a/migrations/05-groups.sql +++ /dev/null @@ -1,25 +0,0 @@ -INSERT IGNORE INTO auth_user_groups (id, user_id, group_id) - SELECT NULL, users_users.userId, 1 - FROM users_users, users_usergroups - WHERE users_users.userId = users_usergroups.userId - AND users_usergroups.groupName = 'Forum Moderators'; - -INSERT INTO authority_permission - VALUES - (NULL,'forums_forum.thread_edit_forum',14,1,NULL,1,47963,1, - '2010-05-20 10:37:22','2010-05-20 10:39:57'), - (NULL,'forums_forum.thread_delete_forum',14,1,NULL,1,47963,1, - '2010-05-20 10:37:22','2010-05-20 10:37:22'), - (NULL,'forums_forum.thread_sticky_forum',14,1,NULL,1,47963,1, - '2010-05-20 10:37:22','2010-05-20 10:37:22'), - (NULL,'forums_forum.post_edit_forum',14,1,NULL,1,47963,1, - '2010-05-20 10:37:22','2010-05-20 10:37:22'), - (NULL,'forums_forum.post_delete_forum',14,1,NULL,1,47963,1, - '2010-05-20 10:37:22','2010-05-20 10:37:22'); - -UPDATE auth_user - SET is_superuser = 1, is_staff = 1 - WHERE id IN (SELECT users_users.userId - FROM users_users, users_usergroups - WHERE users_users.userId = users_usergroups.userId - AND users_usergroups.groupName = 'System Admins'); diff --git a/migrations/06-admin-log.sql b/migrations/06-admin-log.sql deleted file mode 100644 index 5bc553287..000000000 --- a/migrations/06-admin-log.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE IF NOT EXISTS `django_admin_log` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `action_time` datetime NOT NULL, - `user_id` integer NOT NULL, - `content_type_id` integer, - `object_id` longtext, - `object_repr` varchar(200) NOT NULL, - `action_flag` smallint UNSIGNED NOT NULL, - `change_message` longtext NOT NULL -) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci -; -ALTER TABLE `django_admin_log` ADD CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`); -ALTER TABLE `django_admin_log` ADD CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`); -CREATE INDEX `django_admin_log_user_id` ON `django_admin_log` (`user_id`); -CREATE INDEX `django_admin_log_content_type_id` ON `django_admin_log` (`content_type_id`); -COMMIT; diff --git a/migrations/07-on-delete-set-null.sql b/migrations/07-on-delete-set-null.sql deleted file mode 100644 index 140b78fbf..000000000 --- a/migrations/07-on-delete-set-null.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `forums_thread` ADD CONSTRAINT `last_post_id_refs_id_3fa89f33` FOREIGN KEY (`last_post_id`) REFERENCES `forums_post` (`id`) ON DELETE SET NULL; -ALTER TABLE `forums_forum` ADD CONSTRAINT `last_post_id_refs_id_e3773179` FOREIGN KEY (`last_post_id`) REFERENCES `forums_post` (`id`) ON DELETE SET NULL; diff --git a/migrations/08-notifications.sql b/migrations/08-notifications.sql deleted file mode 100644 index 65d84c7d5..000000000 --- a/migrations/08-notifications.sql +++ /dev/null @@ -1,14 +0,0 @@ -CREATE TABLE `notifications_eventwatch` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `content_type_id` integer NOT NULL, - `watch_id` integer NOT NULL, - `email` varchar(75) NOT NULL, - UNIQUE (`content_type_id`, `watch_id`, `email`) -) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci -; -ALTER TABLE `notifications_eventwatch` ADD CONSTRAINT `content_type_id_refs_id_1b6122ce` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`); -CREATE INDEX `notifications_eventwatch_content_type_id` ON `notifications_eventwatch` (`content_type_id`); -CREATE INDEX `notifications_eventwatch_watch_id` ON `notifications_eventwatch` (`watch_id`); -CREATE INDEX `notifications_eventwatch_email` ON `notifications_eventwatch` (`email`); - --- django_content_type and auth_permission entries are made in 10-create-questions-app.sql due to an historical deployment contingency. diff --git a/migrations/09-add-updated-by.sql b/migrations/09-add-updated-by.sql deleted file mode 100644 index afcd4c0d5..000000000 --- a/migrations/09-add-updated-by.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `forums_post` ADD `updated_by_id` integer; -ALTER TABLE `forums_post` ADD CONSTRAINT `post_updated_by_id_refs_id_5c0b8875` FOREIGN KEY (`updated_by_id`) REFERENCES `auth_user` (`id`) ON DELETE SET NULL; diff --git a/migrations/10-create-questions-app.sql b/migrations/10-create-questions-app.sql deleted file mode 100644 index 01b2e48f4..000000000 --- a/migrations/10-create-questions-app.sql +++ /dev/null @@ -1,91 +0,0 @@ -BEGIN; - --- The eventwatch type is made here due to an historical deployment contingency: -INSERT INTO django_content_type (name, app_label, model) VALUES ('event watch', 'notifications', 'eventwatch'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add event watch', @ct, 'add_eventwatch'), - ('Can change event watch', @ct, 'change_eventwatch'), - ('Can delete event watch', @ct, 'delete_eventwatch'); - -CREATE TABLE `questions_questionforum` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `name` varchar(50) NOT NULL UNIQUE, - `slug` varchar(50) NOT NULL UNIQUE -) ENGINE=InnoDB CHARSET=utf8 -; -CREATE TABLE `questions_question` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `title` varchar(255) NOT NULL, - `forum_id` integer NOT NULL, - `creator_id` integer NOT NULL, - `content` longtext NOT NULL, - `created` datetime NOT NULL, - `updated` datetime, - `updated_by_id` integer, - `last_answer_id` integer, - `num_answers` integer NOT NULL, - `status` integer NOT NULL, - `is_locked` bool NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `questions_question` ADD CONSTRAINT `creator_id_refs_id_723e3a28` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `questions_question` ADD CONSTRAINT `updated_by_id_refs_id_723e3a28` FOREIGN KEY (`updated_by_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `questions_question` ADD CONSTRAINT `forum_id_refs_id_334b13f3` FOREIGN KEY (`forum_id`) REFERENCES `questions_questionforum` (`id`); -CREATE TABLE `questions_questionmetadata` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `question_id` integer NOT NULL, - `name` varchar(50) NOT NULL, - `value` longtext NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `questions_questionmetadata` ADD CONSTRAINT `question_id_refs_id_199b1870` FOREIGN KEY (`question_id`) REFERENCES `questions_question` (`id`); -CREATE TABLE `questions_answer` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `question_id` integer NOT NULL, - `creator_id` integer NOT NULL, - `created` datetime NOT NULL, - `content` longtext NOT NULL, - `updated` datetime, - `updated_by_id` integer, - `upvotes` integer NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `questions_answer` ADD CONSTRAINT `creator_id_refs_id_30a2e948` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `questions_answer` ADD CONSTRAINT `updated_by_id_refs_id_30a2e948` FOREIGN KEY (`updated_by_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `questions_answer` ADD CONSTRAINT `question_id_refs_id_5dadc1b3` FOREIGN KEY (`question_id`) REFERENCES `questions_question` (`id`); -ALTER TABLE `questions_question` ADD CONSTRAINT `last_answer_id_refs_id_6a0465b3` FOREIGN KEY (`last_answer_id`) REFERENCES `questions_answer` (`id`); -CREATE INDEX `questions_question_forum_id` ON `questions_question` (`forum_id`); -CREATE INDEX `questions_question_creator_id` ON `questions_question` (`creator_id`); -CREATE INDEX `questions_question_created` ON `questions_question` (`created`); -CREATE INDEX `questions_question_updated` ON `questions_question` (`updated`); -CREATE INDEX `questions_question_updated_by_id` ON `questions_question` (`updated_by_id`); -CREATE INDEX `questions_question_last_answer_id` ON `questions_question` (`last_answer_id`); -CREATE INDEX `questions_question_num_answers` ON `questions_question` (`num_answers`); -CREATE INDEX `questions_question_status` ON `questions_question` (`status`); -CREATE INDEX `questions_questionmetadata_question_id` ON `questions_questionmetadata` (`question_id`); -CREATE INDEX `questions_questionmetadata_name` ON `questions_questionmetadata` (`name`); -CREATE INDEX `questions_answer_question_id` ON `questions_answer` (`question_id`); -CREATE INDEX `questions_answer_creator_id` ON `questions_answer` (`creator_id`); -CREATE INDEX `questions_answer_created` ON `questions_answer` (`created`); -CREATE INDEX `questions_answer_updated` ON `questions_answer` (`updated`); -CREATE INDEX `questions_answer_updated_by_id` ON `questions_answer` (`updated_by_id`); -CREATE INDEX `questions_answer_upvotes` ON `questions_answer` (`upvotes`); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('question', 'questions', 'question'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add question', @ct, 'add_question'), - ('Can change question', @ct, 'change_question'), - ('Can delete question', @ct, 'delete_question'); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('question meta data', 'questions', 'questionmetadata'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add question meta data', @ct, 'add_questionmetadata'), - ('Can change question meta data', @ct, 'change_questionmetadata'), - ('Can delete question meta data', @ct, 'delete_questionmetadata'); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('answer', 'questions', 'answer'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add answer', @ct, 'add_answer'), - ('Can change answer', @ct, 'change_answer'), - ('Can delete answer', @ct, 'delete_answer'); -COMMIT; diff --git a/migrations/11-drop-questionforum.sql b/migrations/11-drop-questionforum.sql deleted file mode 100644 index 1166deaa2..000000000 --- a/migrations/11-drop-questionforum.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE questions_question DROP FOREIGN KEY forum_id_refs_id_334b13f3; -ALTER TABLE questions_question DROP forum_id; -DROP TABLE questions_questionforum; \ No newline at end of file diff --git a/migrations/12-add-solution-id.sql b/migrations/12-add-solution-id.sql deleted file mode 100644 index 25513a976..000000000 --- a/migrations/12-add-solution-id.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `questions_question` ADD `solution_id` integer; -ALTER TABLE `questions_question` ADD CONSTRAINT `solution_id_refs_id_95fb9a4d` FOREIGN KEY (`solution_id`) REFERENCES `questions_answer` (`id`); diff --git a/migrations/13-notification-hash.sql b/migrations/13-notification-hash.sql deleted file mode 100644 index 589f14b4f..000000000 --- a/migrations/13-notification-hash.sql +++ /dev/null @@ -1,5 +0,0 @@ --- Application: notifications --- Model: EventWatch -ALTER TABLE `notifications_eventwatch` - ADD `hash` varchar(40); -CREATE INDEX `hash` ON `notifications_eventwatch` (`hash`); diff --git a/migrations/14-add-question-votes.sql b/migrations/14-add-question-votes.sql deleted file mode 100644 index 14f47f0f6..000000000 --- a/migrations/14-add-question-votes.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE `questions_questionvote` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `question_id` integer NOT NULL, - `created` datetime NOT NULL, - `creator_id` integer, - `anonymous_id` varchar(40) NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `questions_questionvote` ADD CONSTRAINT `question_id_refs_id_9dde00db` FOREIGN KEY (`question_id`) REFERENCES `questions_question` (`id`); -ALTER TABLE `questions_questionvote` ADD CONSTRAINT `creator_id_refs_id_699edd80` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -CREATE INDEX `questions_questionvote_question_id` ON `questions_questionvote` (`question_id`); -CREATE INDEX `questions_questionvote_created` ON `questions_questionvote` (`created`); -CREATE INDEX `questions_questionvote_creator_id` ON `questions_questionvote` (`creator_id`); -CREATE INDEX `questions_questionvote_anonymous_id` ON `questions_questionvote` (`anonymous_id`); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('question vote', 'questions', 'questionvote'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add question vote', @ct, 'add_questionvote'), - ('Can change question vote', @ct, 'change_questionvote'), - ('Can delete question vote', @ct, 'delete_questionvote'); diff --git a/migrations/15-add-answer-votes.sql b/migrations/15-add-answer-votes.sql deleted file mode 100644 index edb07f499..000000000 --- a/migrations/15-add-answer-votes.sql +++ /dev/null @@ -1,21 +0,0 @@ -CREATE TABLE `questions_answervote` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `answer_id` integer NOT NULL, - `helpful` bool NOT NULL, - `created` datetime NOT NULL, - `creator_id` integer, - `anonymous_id` varchar(40) NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `questions_answervote` ADD CONSTRAINT `answer_id_refs_id_112ad03b` FOREIGN KEY (`answer_id`) REFERENCES `questions_answer` (`id`); -ALTER TABLE `questions_answervote` ADD CONSTRAINT `creator_id_refs_id_73284cb0` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -CREATE INDEX `questions_answervote_answer_id` ON `questions_answervote` (`answer_id`); -CREATE INDEX `questions_answervote_created` ON `questions_answervote` (`created`); -CREATE INDEX `questions_answervote_creator_id` ON `questions_answervote` (`creator_id`); -CREATE INDEX `questions_answervote_anonymous_id` ON `questions_answervote` (`anonymous_id`); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('answer vote', 'questions', 'answervote'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add answer vote', @ct, 'add_answervote'), - ('Can change answer vote', @ct, 'change_answervote'), - ('Can delete answer vote', @ct, 'delete_answervote'); diff --git a/migrations/16-add-weekly-vote-count.sql b/migrations/16-add-weekly-vote-count.sql deleted file mode 100644 index 51dcc5b85..000000000 --- a/migrations/16-add-weekly-vote-count.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `questions_question` - ADD `num_votes_past_week` integer UNSIGNED DEFAULT 0; -CREATE INDEX `questions_question_num_votes_past_week_idx` - ON `questions_question` (`num_votes_past_week`); diff --git a/migrations/17-add-tagging.sql b/migrations/17-add-tagging.sql deleted file mode 100644 index 34b83d55a..000000000 --- a/migrations/17-add-tagging.sql +++ /dev/null @@ -1,36 +0,0 @@ --- django-taggit stuff: -- - -CREATE TABLE `taggit_tag` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `name` varchar(100) NOT NULL UNIQUE, - `slug` varchar(100) NOT NULL UNIQUE -) ENGINE=InnoDB CHARSET=utf8 -; -CREATE TABLE `taggit_taggeditem` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `tag_id` integer NOT NULL, - `object_id` integer NOT NULL, - `content_type_id` integer NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `taggit_taggeditem` ADD CONSTRAINT `tag_id_refs_id_c87e3f85` FOREIGN KEY (`tag_id`) REFERENCES `taggit_tag` (`id`); -ALTER TABLE `taggit_taggeditem` ADD CONSTRAINT `content_type_id_refs_id_5a2b7711` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`); -CREATE INDEX `taggit_taggeditem_3747b463` ON `taggit_taggeditem` (`tag_id`); -CREATE INDEX `taggit_taggeditem_e4470c6e` ON `taggit_taggeditem` (`content_type_id`); - --- Added a unique constraint on taggit_tag.name. This keeps tag names case-insensitively unique, since we use MySQL's default collation for utf8, utf8_general_ci. - - -insert into auth_permission (name, content_type_id, codename) values ('Can add tags to and remove tags from questions', (select id from django_content_type where app_label='questions' and model='question'), 'tag_question'); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('Tag', 'taggit', 'tag'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add tag', @ct, 'add_tag'), - ('Can change tag', @ct, 'change_tag'), - ('Can delete tag', @ct, 'delete_tag'); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('Tagged Item', 'taggit', 'taggeditem'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add tagged item', @ct, 'add_taggeditem'), - ('Can change tagged item', @ct, 'change_taggeditem'), - ('Can delete tagged item', @ct, 'delete_taggeditem'); diff --git a/migrations/18-lock-question-permission.sql b/migrations/18-lock-question-permission.sql deleted file mode 100644 index a0200a098..000000000 --- a/migrations/18-lock-question-permission.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO auth_permission (name, content_type_id, codename) - VALUES ('Can lock question', - (select id from django_content_type where app_label='questions' and model='question'), - 'lock_question'); diff --git a/migrations/19-flag-content.sql b/migrations/19-flag-content.sql deleted file mode 100644 index 197864f6e..000000000 --- a/migrations/19-flag-content.sql +++ /dev/null @@ -1,23 +0,0 @@ -CREATE TABLE `flagit_flaggedobject` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `content_type_id` integer NOT NULL, - `object_id` integer UNSIGNED NOT NULL, - `status` integer NOT NULL, - `reason` varchar(64) NOT NULL, - `notes` longtext NOT NULL, - `creator_id` integer NOT NULL, - `created` datetime NOT NULL, - `handled` datetime NOT NULL, - `handled_by_id` integer, - UNIQUE (`content_type_id`, `object_id`, `creator_id`) -) -; -ALTER TABLE `flagit_flaggedobject` ADD CONSTRAINT `content_type_id_refs_id_6f4cf8f9` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`); -ALTER TABLE `flagit_flaggedobject` ADD CONSTRAINT `creator_id_refs_id_402bce45` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `flagit_flaggedobject` ADD CONSTRAINT `handled_by_id_refs_id_402bce45` FOREIGN KEY (`handled_by_id`) REFERENCES `auth_user` (`id`); -CREATE INDEX `flagit_flaggedobject_e4470c6e` ON `flagit_flaggedobject` (`content_type_id`); -CREATE INDEX `flagit_flaggedobject_c9ad71dd` ON `flagit_flaggedobject` (`status`); -CREATE INDEX `flagit_flaggedobject_f97a5119` ON `flagit_flaggedobject` (`creator_id`); -CREATE INDEX `flagit_flaggedobject_3216ff68` ON `flagit_flaggedobject` (`created`); -CREATE INDEX `flagit_flaggedobject_a8d7f3ae` ON `flagit_flaggedobject` (`handled`); -CREATE INDEX `flagit_flaggedobject_c77d7f80` ON `flagit_flaggedobject` (`handled_by_id`); diff --git a/migrations/20-unique-metadata-question-and-name.sql b/migrations/20-unique-metadata-question-and-name.sql deleted file mode 100644 index a633d8018..000000000 --- a/migrations/20-unique-metadata-question-and-name.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE UNIQUE INDEX `questions_questionmetadata_question_and_name_idx` - ON `questions_questionmetadata` (`question_id`, `name`); diff --git a/migrations/21-notification-event-type.sql b/migrations/21-notification-event-type.sql deleted file mode 100644 index 194f42167..000000000 --- a/migrations/21-notification-event-type.sql +++ /dev/null @@ -1,10 +0,0 @@ -ALTER TABLE `notifications_eventwatch` - ADD `event_type` varchar(20); -CREATE INDEX `notifications_eventwatch_event_type_idx` - ON `notifications_eventwatch` (`event_type`); -ALTER TABLE notifications_eventwatch - DROP KEY content_type_id; -ALTER TABLE notifications_eventwatch - ADD UNIQUE (`content_type_id`,`watch_id`,`email`, `event_type`); -UPDATE notifications_eventwatch - SET event_type = 'reply'; diff --git a/migrations/22-image-upload.sql b/migrations/22-image-upload.sql deleted file mode 100644 index 9bf06e1ef..000000000 --- a/migrations/22-image-upload.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; --- Application: upload --- Model: ImageAttachment -CREATE TABLE `upload_imageattachment` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `file` varchar(100) NOT NULL, - `thumbnail` varchar(100) NOT NULL, - `creator_id` integer NOT NULL, - `content_type_id` integer NOT NULL, - `object_id` integer UNSIGNED NOT NULL -) -; -ALTER TABLE `upload_imageattachment` ADD CONSTRAINT `creator_id_refs_id_c6b152a0` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `upload_imageattachment` ADD CONSTRAINT `content_type_id_refs_id_e616c0dc` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`); -CREATE INDEX `upload_imageattachment_f97a5119` ON `upload_imageattachment` (`creator_id`); -CREATE INDEX `upload_imageattachment_e4470c6e` ON `upload_imageattachment` (`content_type_id`); -COMMIT; diff --git a/migrations/23-aaq-confirmation-id.sql b/migrations/23-aaq-confirmation-id.sql deleted file mode 100644 index 51e698442..000000000 --- a/migrations/23-aaq-confirmation-id.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE `questions_question` ADD `confirmation_id` varchar(40) NOT NULL; -CREATE INDEX `questions_question_confirmation_id` ON `questions_question` (`confirmation_id`); - -UPDATE questions_question SET status = 1; diff --git a/migrations/24-add-os-tags.sql b/migrations/24-add-os-tags.sql deleted file mode 100644 index 618bea54e..000000000 --- a/migrations/24-add-os-tags.sql +++ /dev/null @@ -1,21 +0,0 @@ -INSERT INTO taggit_tag (name, slug) VALUES ('Windows 3.11', 'windows-311') ON DUPLICATE KEY UPDATE name='Windows 3.11', slug='windows-311'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows 95', 'windows-95') ON DUPLICATE KEY UPDATE name='Windows 95', slug='windows-95'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows 98', 'windows-98') ON DUPLICATE KEY UPDATE name='Windows 98', slug='windows-98'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows 2000', 'windows-2000') ON DUPLICATE KEY UPDATE name='Windows 2000', slug='windows-2000'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows XP', 'windows-xp') ON DUPLICATE KEY UPDATE name='Windows XP', slug='windows-xp'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows Server 2003', 'windows-server-2003') ON DUPLICATE KEY UPDATE name='Windows Server 2003', slug='windows-server-2003'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows Vista', 'windows-vista') ON DUPLICATE KEY UPDATE name='Windows Vista', slug='windows-vista'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows 7', 'windows-7') ON DUPLICATE KEY UPDATE name='Windows 7', slug='windows-7'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows NT 4.0', 'windows-nt-40') ON DUPLICATE KEY UPDATE name='Windows NT 4.0', slug='windows-nt-40'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows ME', 'windows-me') ON DUPLICATE KEY UPDATE name='Windows ME', slug='windows-me'; -INSERT INTO taggit_tag (name, slug) VALUES ('Windows', 'windows') ON DUPLICATE KEY UPDATE name='Windows', slug='windows'; -INSERT INTO taggit_tag (name, slug) VALUES ('OpenBSD', 'openbsd') ON DUPLICATE KEY UPDATE name='OpenBSD', slug='openbsd'; -INSERT INTO taggit_tag (name, slug) VALUES ('SunOS', 'sunos') ON DUPLICATE KEY UPDATE name='SunOS', slug='sunos'; -INSERT INTO taggit_tag (name, slug) VALUES ('Linux', 'linux') ON DUPLICATE KEY UPDATE name='Linux', slug='linux'; -INSERT INTO taggit_tag (name, slug) VALUES ('Mac OS X 10.4', 'mac-os-x-104') ON DUPLICATE KEY UPDATE name='Mac OS X 10.4', slug='mac-os-x-104'; -INSERT INTO taggit_tag (name, slug) VALUES ('Mac OS X 10.5', 'mac-os-x-105') ON DUPLICATE KEY UPDATE name='Mac OS X 10.5', slug='mac-os-x-105'; -INSERT INTO taggit_tag (name, slug) VALUES ('Mac OS X 10.6', 'mac-os-x-106') ON DUPLICATE KEY UPDATE name='Mac OS X 10.6', slug='mac-os-x-106'; -INSERT INTO taggit_tag (name, slug) VALUES ('Mac OS', 'mac-os') ON DUPLICATE KEY UPDATE name='Mac OS', slug='mac-os'; -INSERT INTO taggit_tag (name, slug) VALUES ('QNX', 'qnx') ON DUPLICATE KEY UPDATE name='QNX', slug='qnx'; -INSERT INTO taggit_tag (name, slug) VALUES ('BeOS', 'beos') ON DUPLICATE KEY UPDATE name='BeOS', slug='beos'; -INSERT INTO taggit_tag (name, slug) VALUES ('OS/2', 'os2') ON DUPLICATE KEY UPDATE name='OS/2', slug='os2'; diff --git a/migrations/25-tiki-comments-metadata-id.sql b/migrations/25-tiki-comments-metadata-id.sql deleted file mode 100644 index d5b2dcfde..000000000 --- a/migrations/25-tiki-comments-metadata-id.sql +++ /dev/null @@ -1,31 +0,0 @@ --- Django cannot do composite primary keys, so we're adding and id column --- to this table. - -ALTER TABLE tiki_comments_metadata DROP PRIMARY KEY; - -CREATE UNIQUE INDEX - threadId_name -ON - tiki_comments_metadata(threadId, name); - -ALTER TABLE - tiki_comments_metadata -ADD - id INT NOT NULL AUTO_INCREMENT KEY; - - --- Rename FakeUser to something more friendly -UPDATE - users_users -SET - login = 'AnonymousUser' -WHERE - login = 'FakeUser'; - - -UPDATE - auth_user -SET - username = 'AnonymousUser' -WHERE - username = 'FakeUser'; diff --git a/migrations/26-index-tagged-object.sql b/migrations/26-index-tagged-object.sql deleted file mode 100644 index 0077eea7b..000000000 --- a/migrations/26-index-tagged-object.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Create an index on taggit_taggeditem.object_id - -CREATE INDEX `taggit_taggeditem_c32a93c2` ON `taggit_taggeditem` (`object_id`); diff --git a/migrations/27-lock-tiki-forum.sql b/migrations/27-lock-tiki-forum.sql deleted file mode 100644 index d28566de9..000000000 --- a/migrations/27-lock-tiki-forum.sql +++ /dev/null @@ -1,8 +0,0 @@ -UPDATE - tiki_comments -SET - type = 'l' -WHERE - parentId = 0 - AND objectType = 'forum' - AND object = 6; diff --git a/migrations/28-flagit-moderation-permission.sql b/migrations/28-flagit-moderation-permission.sql deleted file mode 100644 index c55827f11..000000000 --- a/migrations/28-flagit-moderation-permission.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO django_content_type (name, app_label, model) VALUES ('Flagged Object', 'flagit', 'flaggedobject'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can moderate flagged objects', @ct, 'can_moderate'); diff --git a/migrations/29-orphaned-flags.sql b/migrations/29-orphaned-flags.sql deleted file mode 100644 index 88149b0f5..000000000 --- a/migrations/29-orphaned-flags.sql +++ /dev/null @@ -1,44 +0,0 @@ --- Delete orphaned flags on questions -DELETE FROM - flagit_flaggedobject -WHERE - object_id NOT IN - ( - SELECT - q.id - FROM - questions_question q - ) - AND content_type_id = - ( - SELECT - id - FROM - django_content_type - WHERE - name = 'question' - AND app_label = 'questions' - ); - - --- Delete orphaned flags on answers -DELETE FROM - flagit_flaggedobject -WHERE - object_id NOT IN - ( - SELECT - a.id - FROM - questions_answer a - ) - AND content_type_id = - ( - SELECT - id - FROM - django_content_type - WHERE - name = 'answer' - AND app_label = 'questions' - ); diff --git a/migrations/30-move-thread-permission.sql b/migrations/30-move-thread-permission.sql deleted file mode 100644 index c1cad72b8..000000000 --- a/migrations/30-move-thread-permission.sql +++ /dev/null @@ -1,11 +0,0 @@ -INSERT INTO authority_permission - VALUES - (NULL,'forums_forum.thread_move_forum', - (select id from django_content_type where app_label='forums' and model='forum'),1,NULL,1,47963,1, - '2010-08-10 10:37:22','2010-08-10 10:39:57'), - (NULL,'forums_forum.thread_move_forum', - (select id from django_content_type where app_label='forums' and model='forum'),2,NULL,1,47963,1, - '2010-08-10 10:37:22','2010-08-10 10:39:57'), - (NULL,'forums_forum.thread_move_forum', - (select id from django_content_type where app_label='forums' and model='forum'),3,NULL,1,47963,1, - '2010-08-10 10:37:22','2010-08-10 10:39:57'); diff --git a/migrations/31-restricted-forum-permissions.sql b/migrations/31-restricted-forum-permissions.sql deleted file mode 100644 index 07b506d09..000000000 --- a/migrations/31-restricted-forum-permissions.sql +++ /dev/null @@ -1,4 +0,0 @@ -SET @ct = (SELECT id FROM django_content_type WHERE app_label='forums' AND model='forum'); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES - ('Can view restricted forums', @ct, 'view_in_forum'), - ('Can post in restricted forums', @ct, 'post_in_forum'); diff --git a/migrations/32-customercare-tweets.sql b/migrations/32-customercare-tweets.sql deleted file mode 100644 index 34c43be46..000000000 --- a/migrations/32-customercare-tweets.sql +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN; -CREATE TABLE `customercare_tweet` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `tweet_id` bigint NOT NULL UNIQUE, - `raw_json` longtext NOT NULL, - `locale` varchar(20) NOT NULL, - `created` datetime NOT NULL -) -; -CREATE INDEX `customercare_tweet_928541cb` ON `customercare_tweet` (`locale`); -CREATE INDEX `customercare_tweet_3216ff68` ON `customercare_tweet` (`created`); -COMMIT; diff --git a/migrations/33-customercare-cannedresponses.sql b/migrations/33-customercare-cannedresponses.sql deleted file mode 100644 index 083bab066..000000000 --- a/migrations/33-customercare-cannedresponses.sql +++ /dev/null @@ -1,27 +0,0 @@ -BEGIN; -CREATE TABLE `customercare_cannedcategory` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `title` varchar(255) NOT NULL, - `weight` integer NOT NULL -) -; -CREATE TABLE `customercare_cannedresponse` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `title` varchar(255) NOT NULL, - `response` varchar(140) NOT NULL -) -; -CREATE TABLE `customercare_categorymembership` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `category_id` integer NOT NULL, - `response_id` integer NOT NULL, - `weight` integer NOT NULL -) -; -ALTER TABLE `customercare_categorymembership` ADD CONSTRAINT `category_id_refs_id_e187a5e8` FOREIGN KEY (`category_id`) REFERENCES `customercare_cannedcategory` (`id`); -ALTER TABLE `customercare_categorymembership` ADD CONSTRAINT `response_id_refs_id_8f9177e9` FOREIGN KEY (`response_id`) REFERENCES `customercare_cannedresponse` (`id`); -CREATE INDEX `customercare_cannedcategory_f8f0a775` ON `customercare_cannedcategory` (`weight`); -CREATE INDEX `customercare_categorymembership_42dc49bc` ON `customercare_categorymembership` (`category_id`); -CREATE INDEX `customercare_categorymembership_d5ea739f` ON `customercare_categorymembership` (`response_id`); -CREATE INDEX `customercare_categorymembership_f8f0a775` ON `customercare_categorymembership` (`weight`); -COMMIT; diff --git a/migrations/34-customercare-acls.sql b/migrations/34-customercare-acls.sql deleted file mode 100644 index e85bb0529..000000000 --- a/migrations/34-customercare-acls.sql +++ /dev/null @@ -1,24 +0,0 @@ -INSERT IGNORE INTO `django_content_type` (`name`, `app_label`, `model`) VALUES -('tweet', 'customercare', 'tweet'), -('canned category', 'customercare', 'cannedcategory'), -('canned response', 'customercare', 'cannedresponse'), -('category membership', 'customercare', 'categorymembership'); - -SET @tweet_ct = (SELECT `id` FROM `django_content_type` WHERE `name` = 'tweet'); -SET @canned_cat_ct = (SELECT `id` FROM `django_content_type` WHERE `name` = 'canned category'); -SET @canned_resp_ct = (SELECT `id` FROM `django_content_type` WHERE `name` = 'canned response'); -SET @cat_member_ct = (SELECT `id` FROM `django_content_type` WHERE `name` = 'category membership'); - -INSERT IGNORE INTO `auth_permission` (`name`, `content_type_id`, `codename`) VALUES -('Can add tweet', @tweet_ct, 'add_tweet'), -('Can change tweet', @tweet_ct, 'change_tweet'), -('Can delete tweet', @tweet_ct, 'delete_tweet'), -('Can add canned category', @canned_cat_ct, 'add_cannedcategory'), -('Can change canned category', @canned_cat_ct, 'change_cannedcategory'), -('Can delete canned category', @canned_cat_ct, 'delete_cannedcategory'), -('Can add canned response', @canned_resp_ct, 'add_cannedresponse'), -('Can change canned response', @canned_resp_ct, 'change_cannedresponse'), -('Can delete canned response', @canned_resp_ct, 'delete_cannedresponse'), -('Can add category membership', @cat_member_ct, 'add_categorymembership'), -('Can change category membership', @cat_member_ct, 'change_categorymembership'), -('Can delete category membership', @cat_member_ct, 'delete_categorymembership'); diff --git a/migrations/35-cannedresponses-initialdata.sql b/migrations/35-cannedresponses-initialdata.sql deleted file mode 100644 index b85519123..000000000 --- a/migrations/35-cannedresponses-initialdata.sql +++ /dev/null @@ -1,50 +0,0 @@ -INSERT INTO `customercare_cannedcategory` (`id`, `title`, `weight`) VALUES -(1, "Welcome and Thanks", 0), -(2, "Using Firefox", 1), -(3, "Firefox Beta", 2), -(4, "Support", 3), -(5, "Get Involved", 4); - -INSERT INTO `customercare_cannedresponse` (`id`, `title`, `response`) VALUES -(1, "Welcome to our community", "Thanks for joining Mozilla! You're now part of our global community. We're here if you need help: http://mzl.la/bMDof6"), -(2, "Thanks for using Firefox", "Thanks for using Firefox! You're not just a user to us, but part of a community that's 400M strong: http://mzl.la/9whtWo"), -(3, "We're a non-profit organization", "Hey, I'm a Mozilla volunteer. Did you know Mozilla is made up of 1000s of us worldwide? More here: http://mzl.la/cvlwvd"), -(4, "Tip & tricks", "Need help getting started with Firefox? Here are some tips & tricks for getting the most out of it: http://mzl.la/c0B9P2"), -(5, "Customize Firefox with add-ons", "Have you tried add-ons? Cool apps for shopping, music, news, whatever you do online. Start here: http://mzl.la/blOuoD"), -(6, "Add-on reviews", "Just getting started with Firefox? Add-ons personalize it with cool features & function. User reviews: http://mzl.la/cGypVI"), -(7, "Upgrade Firefox", "Hey, maybe you need to upgrade Firefox? New version is speedier with a lot more going on. Download: http://mzl.la/9wJe30"), -(8, "Update plugins and add-ons", "Have you updated your plug-ins and add-ons? Should work out the kinks. Here's the place to refresh: http://mzl.la/cGCg12"), -(9, "Try the Beta", "Try the future of Firefox! We need your help testing the new beta. Hop on board: http://mzl.la/d23n7a"), -(10, "Firefox Sync", "Tried Firefox Sync? It's awesome! Switch computers & it saves open tabs, pwords, history. Try it: http://mzl.la/aHHUYA"), -(11, "Firefox Panorama", "Heard about Firefox Panorama? It groups and displays your tabs, eliminating clutter. Give it a whirl! http://mzl.la/d21MyY"), -(12, "Fix crashes", "Sorry your Firefox is crashing. Here's a list of quick fixes to prevent that from happening again: http://mzl.la/atSsFt"), -(13, "Slow Firefox startup", "Slow start could mean your Firefox just needs a refresh. Here are tips to make Firefox load faster: http://mzl.la/9bB1FY"), -(14, "Quick Firefox fixes", "Have you tried Firefox support? If their quick fixes don't solve it, volunteers are ready to help out: http://mzl.la/9V9uWd"), -(15, "Ask SUMO", "Maybe ask SUMO about this issue? Firefox's community support team. They'll know what's up: http://mzl.la/bMDof6"), -(16, "Get involved with Mozilla", "Want a better web? Join the Mozilla movement. There is something to do for everyone. Get started: http://mzl.la/cufJmX"), -(17, "Join Drumbeat", "Want to spark a movement? Mozilla Drumbeat is your chance to keep the web open and free. More info: http://mzl.la/aIXCLA"), -(18, "Become a beta tester", "Become a beta tester! Help develop the next Firefox. You don't have to be a techie to contribute: http://mzl.la/d23n7a"), -(19, "Mozilla Developer Network", "Open up the web & make it better! Build web pages, apps and add-ons here: Mozilla Developer Network http://mzl.la/9gQfrn"), -(20, "Report a bug", "Thanks for finding a bug. It makes everyone's Firefox experience better if you report it. It''s easy: http://mzl.la/bcujVc"); - -INSERT INTO `customercare_categorymembership` (`id`, `category_id`, `response_id`, `weight`) VALUES -(1, 1, 1, 0), -(2, 1, 2, 1), -(3, 1, 3, 2), -(4, 1, 4, 3), -(5, 2, 5, 0), -(6, 2, 6, 1), -(7, 2, 7, 2), -(8, 2, 8, 3), -(9, 3, 9, 0), -(10, 3, 10, 1), -(11, 3, 11, 2), -(12, 4, 12, 0), -(13, 4, 13, 1), -(14, 4, 14, 2), -(15, 4, 15, 3), -(16, 5, 16, 0), -(17, 5, 17, 1), -(18, 5, 18, 2), -(19, 5, 19, 3), -(20, 5, 20, 4); diff --git a/migrations/36-answer-page.sql b/migrations/36-answer-page.sql deleted file mode 100644 index f93b336de..000000000 --- a/migrations/36-answer-page.sql +++ /dev/null @@ -1,14 +0,0 @@ --- Model: Answer -ALTER TABLE `questions_answer` - ADD `page` integer default 1; - --- Set page numbers for existing answers. -UPDATE questions_answer a -SET - page = ( - SELECT COUNT(*) - FROM ( - SELECT id, question_id, created - FROM questions_answer) b - WHERE b.question_id = a.question_id AND b.created < a.created - ) / 20 + 1; diff --git a/migrations/37-wiki-app.sql b/migrations/37-wiki-app.sql deleted file mode 100644 index 3431d5926..000000000 --- a/migrations/37-wiki-app.sql +++ /dev/null @@ -1,60 +0,0 @@ -CREATE TABLE `wiki_document` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `title` varchar(255) NOT NULL, - `locale` varchar(7) NOT NULL, - `current_revision_id` integer, - `parent_id` integer, - `html` longtext NOT NULL, - `category` integer NOT NULL, - UNIQUE (`parent_id`, `locale`), - UNIQUE (`title`, `locale`) -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `wiki_document` ADD CONSTRAINT `parent_id_refs_id_6c4b5a5` FOREIGN KEY (`parent_id`) REFERENCES `wiki_document` (`id`); -CREATE TABLE `wiki_revision` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `document_id` integer NOT NULL, - `summary` longtext NOT NULL, - `content` longtext NOT NULL, - `keywords` varchar(255) NOT NULL, - `created` datetime NOT NULL, - `reviewed` datetime, - `significance` integer NOT NULL, - `comment` varchar(255) NOT NULL, - `reviewer_id` integer, - `creator_id` integer NOT NULL, - `is_approved` bool NOT NULL, - `based_on_id` integer -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `wiki_revision` ADD CONSTRAINT `document_id_refs_id_226de0df` FOREIGN KEY (`document_id`) REFERENCES `wiki_document` (`id`); -ALTER TABLE `wiki_revision` ADD CONSTRAINT `reviewer_id_refs_id_4298f2ad` FOREIGN KEY (`reviewer_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `wiki_revision` ADD CONSTRAINT `creator_id_refs_id_4298f2ad` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `wiki_document` ADD CONSTRAINT `current_revision_id_refs_id_79f9a479` FOREIGN KEY (`current_revision_id`) REFERENCES `wiki_revision` (`id`); -ALTER TABLE `wiki_revision` ADD CONSTRAINT `based_on_id_refs_id_cf0bcfb3` FOREIGN KEY (`based_on_id`) REFERENCES `wiki_revision` (`id`); -CREATE TABLE `wiki_firefoxversion` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `item_id` integer NOT NULL, - `document_id` integer NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `wiki_firefoxversion` ADD CONSTRAINT `document_id_refs_id_5d21595b` FOREIGN KEY (`document_id`) REFERENCES `wiki_document` (`id`); -CREATE TABLE `wiki_operatingsystem` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `item_id` integer NOT NULL, - `document_id` integer NOT NULL -) ENGINE=InnoDB CHARSET=utf8 -; -ALTER TABLE `wiki_operatingsystem` ADD CONSTRAINT `document_id_refs_id_e92dd159` FOREIGN KEY (`document_id`) REFERENCES `wiki_document` (`id`); -CREATE INDEX `wiki_document_841a7e28` ON `wiki_document` (`title`); -CREATE INDEX `wiki_document_928541cb` ON `wiki_document` (`locale`); -CREATE INDEX `wiki_document_a253e251` ON `wiki_document` (`current_revision_id`); -CREATE INDEX `wiki_document_63f17a16` ON `wiki_document` (`parent_id`); -CREATE INDEX `wiki_revision_f4226d13` ON `wiki_revision` (`document_id`); -CREATE INDEX `wiki_revision_d0f17e2b` ON `wiki_revision` (`reviewer_id`); -CREATE INDEX `wiki_revision_f97a5119` ON `wiki_revision` (`creator_id`); -CREATE INDEX `wiki_revision_ec4f2057` ON `wiki_revision` (`based_on_id`); -CREATE INDEX `wiki_firefoxversion_67b70d25` ON `wiki_firefoxversion` (`item_id`); -CREATE INDEX `wiki_firefoxversion_f4226d13` ON `wiki_firefoxversion` (`document_id`); -CREATE INDEX `wiki_operatingsystem_67b70d25` ON `wiki_operatingsystem` (`item_id`); -CREATE INDEX `wiki_operatingsystem_f4226d13` ON `wiki_operatingsystem` (`document_id`); diff --git a/migrations/38-wiki-permissions.sql b/migrations/38-wiki-permissions.sql deleted file mode 100644 index b9c60bde3..000000000 --- a/migrations/38-wiki-permissions.sql +++ /dev/null @@ -1,11 +0,0 @@ -INSERT INTO django_content_type (name, app_label, model) VALUES ('document', 'wiki', 'document'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add document', @ct, 'add_document'), - ('Can change document', @ct, 'change_document'), - ('Can delete document', @ct, 'delete_document'); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('revision', 'wiki', 'revision'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES ('Can add revision', @ct, 'add_revision'), - ('Can change revision', @ct, 'change_revision'), - ('Can delete revision', @ct, 'delete_revision'); diff --git a/migrations/39-document-slug.sql b/migrations/39-document-slug.sql deleted file mode 100644 index 2f5f30e31..000000000 --- a/migrations/39-document-slug.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `wiki_document` ADD `slug` varchar(255) NOT NULL; -CREATE INDEX `wiki_document_slug` ON `wiki_document` (`slug`); -CREATE UNIQUE INDEX `slug` ON `wiki_document` (`slug`,`locale`); diff --git a/migrations/40-remove-legacy-forum-types.sql b/migrations/40-remove-legacy-forum-types.sql deleted file mode 100644 index f8602d7fe..000000000 --- a/migrations/40-remove-legacy-forum-types.sql +++ /dev/null @@ -1,9 +0,0 @@ --- Remove the content type and permissions for legacy forum models. - -SET @ct = (SELECT id FROM django_content_type WHERE app_label = 'sumo' AND model = 'forum'); -DELETE FROM auth_permission WHERE content_type_id = @ct; -DELETE FROM django_content_type WHERE id = @ct; - -SET @ct = (SELECT id FROM django_content_type WHERE app_label = 'sumo' AND model = 'forumthread'); -DELETE FROM auth_permission WHERE content_type_id = @ct; -DELETE FROM django_content_type WHERE id = @ct; diff --git a/migrations/41-media-gallery.sql b/migrations/41-media-gallery.sql deleted file mode 100644 index 2d14eeeb4..000000000 --- a/migrations/41-media-gallery.sql +++ /dev/null @@ -1,44 +0,0 @@ --- gallery app, initial tables -CREATE TABLE `gallery_image` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL, - `created` datetime NOT NULL, - `updated` datetime NOT NULL, - `updated_by_id` int(11) DEFAULT NULL, - `description` longtext NOT NULL, - `locale` varchar(7) NOT NULL, - `creator_id` int(11) NOT NULL, - `file` varchar(100) NOT NULL, - `thumbnail` varchar(100) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `gallery_image_title` (`title`), - KEY `gallery_image_created` (`created`), - KEY `gallery_image_updated` (`updated`), - KEY `gallery_image_updated_by_id` (`updated_by_id`), - KEY `gallery_image_locale` (`locale`), - KEY `gallery_image_creator_id` (`creator_id`), - CONSTRAINT `creator_id_refs_id_9add8201` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `updated_by_id_refs_id_9add8201` FOREIGN KEY (`updated_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `gallery_video` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(255) NOT NULL, - `created` datetime NOT NULL, - `updated` datetime NOT NULL, - `updated_by_id` int(11) DEFAULT NULL, - `description` longtext NOT NULL, - `locale` varchar(7) NOT NULL, - `creator_id` int(11) NOT NULL, - `file` varchar(100) NOT NULL, - `thumbnail` varchar(100) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `gallery_video_title` (`title`), - KEY `gallery_video_created` (`created`), - KEY `gallery_video_updated` (`updated`), - KEY `gallery_video_updated_by_id` (`updated_by_id`), - KEY `gallery_video_locale` (`locale`), - KEY `gallery_video_creator_id` (`creator_id`), - CONSTRAINT `creator_id_refs_id_7d7f5ce1` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`), - CONSTRAINT `updated_by_id_refs_id_7d7f5ce1` FOREIGN KEY (`updated_by_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/migrations/42-notifications-object-id-optional.sql b/migrations/42-notifications-object-id-optional.sql deleted file mode 100644 index 9cc29df77..000000000 --- a/migrations/42-notifications-object-id-optional.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `notifications_eventwatch` MODIFY `watch_id` integer; diff --git a/migrations/43-review-revisions.sql b/migrations/43-review-revisions.sql deleted file mode 100644 index abc5d1512..000000000 --- a/migrations/43-review-revisions.sql +++ /dev/null @@ -1,4 +0,0 @@ -INSERT INTO auth_permission (name, content_type_id, codename) - VALUES ('Can review a revision', - (select id from django_content_type where app_label='wiki' and model='revision'), - 'review_revision'); diff --git a/migrations/44-document-template.sql b/migrations/44-document-template.sql deleted file mode 100644 index 41ecb9353..000000000 --- a/migrations/44-document-template.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `wiki_document` ADD `is_template` tinyint(1) NOT NULL DEFAULT 0; -CREATE INDEX `wiki_document_is_template` ON `wiki_document` (`is_template`); diff --git a/migrations/45-gallery-video.sql b/migrations/45-gallery-video.sql deleted file mode 100644 index 5c9a287cc..000000000 --- a/migrations/45-gallery-video.sql +++ /dev/null @@ -1,6 +0,0 @@ -ALTER TABLE `gallery_video` - ADD `webm` varchar(100) NULL, - ADD `ogv` varchar(100) NULL, - ADD `flv` varchar(100) NULL; - -ALTER TABLE `gallery_video` DROP `file`; diff --git a/migrations/46-significance-optional.sql b/migrations/46-significance-optional.sql deleted file mode 100644 index b2551a1dd..000000000 --- a/migrations/46-significance-optional.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `wiki_revision` MODIFY `significance` integer; diff --git a/migrations/47-notifications-locale.sql b/migrations/47-notifications-locale.sql deleted file mode 100644 index 94e420408..000000000 --- a/migrations/47-notifications-locale.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE `notifications_eventwatch` - ADD `locale` varchar(7) DEFAULT ''; -CREATE INDEX `notifications_eventwatch_928541cb` - ON `notifications_eventwatch` (`locale`); -ALTER TABLE notifications_eventwatch - DROP KEY content_type_id; -ALTER TABLE notifications_eventwatch - ADD UNIQUE (`content_type_id`,`watch_id`,`email`, `event_type`, `locale`); diff --git a/migrations/48-add-approved-index.sql b/migrations/48-add-approved-index.sql deleted file mode 100644 index 06b632c05..000000000 --- a/migrations/48-add-approved-index.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Add an index on wiki_revision.is_approved -CREATE INDEX `wiki_revision_is_approved_idx` - ON `wiki_revision` (`is_approved`); diff --git a/migrations/49-video-unique.sql b/migrations/49-video-unique.sql deleted file mode 100644 index fd26edb23..000000000 --- a/migrations/49-video-unique.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE UNIQUE INDEX `gallery_image_locale_title` - ON `gallery_image` (`locale`, `title`); -CREATE UNIQUE INDEX `gallery_video_locale_title` - ON `gallery_video` (`locale`, `title`); diff --git a/migrations/50-kbforums.sql b/migrations/50-kbforums.sql deleted file mode 100644 index 5f9f137c6..000000000 --- a/migrations/50-kbforums.sql +++ /dev/null @@ -1,54 +0,0 @@ -CREATE TABLE `kbforums_thread` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `title` varchar(255) NOT NULL, - `document_id` integer NOT NULL, - `created` datetime NOT NULL, - `creator_id` integer NOT NULL, - `last_post_id` integer, - `replies` integer NOT NULL, - `is_locked` bool NOT NULL, - `is_sticky` bool NOT NULL -) -; -ALTER TABLE `kbforums_thread` ADD CONSTRAINT `creator_id_refs_id_3e559805` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `kbforums_thread` ADD CONSTRAINT `document_id_refs_id_42b206f` FOREIGN KEY (`document_id`) REFERENCES `wiki_document` (`id`); -CREATE TABLE `kbforums_post` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `thread_id` integer NOT NULL, - `content` longtext NOT NULL, - `creator_id` integer NOT NULL, - `created` datetime NOT NULL, - `updated` datetime NOT NULL, - `updated_by_id` integer -) -; -ALTER TABLE `kbforums_post` ADD CONSTRAINT `creator_id_refs_id_4437f68f` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `kbforums_post` ADD CONSTRAINT `updated_by_id_refs_id_4437f68f` FOREIGN KEY (`updated_by_id`) REFERENCES `auth_user` (`id`); -ALTER TABLE `kbforums_post` ADD CONSTRAINT `thread_id_refs_id_61d80e19` FOREIGN KEY (`thread_id`) REFERENCES `kbforums_thread` (`id`); -ALTER TABLE `kbforums_thread` ADD CONSTRAINT `last_post_id_refs_id_773178a1` FOREIGN KEY (`last_post_id`) REFERENCES `kbforums_post` (`id`); -CREATE INDEX `kbforums_thread_bdd92ed` ON `kbforums_thread` (`document_id`); -CREATE INDEX `kbforums_thread_3216ff68` ON `kbforums_thread` (`created`); -CREATE INDEX `kbforums_thread_685aee7` ON `kbforums_thread` (`creator_id`); -CREATE INDEX `kbforums_thread_11738784` ON `kbforums_thread` (`last_post_id`); -CREATE INDEX `kbforums_thread_714cf0d8` ON `kbforums_thread` (`is_sticky`); -CREATE INDEX `kbforums_post_65912a8a` ON `kbforums_post` (`thread_id`); -CREATE INDEX `kbforums_post_685aee7` ON `kbforums_post` (`creator_id`); -CREATE INDEX `kbforums_post_3216ff68` ON `kbforums_post` (`created`); -CREATE INDEX `kbforums_post_8aac229` ON `kbforums_post` (`updated`); -CREATE INDEX `kbforums_post_6f403c1` ON `kbforums_post` (`updated_by_id`);COMMIT; - -INSERT INTO django_content_type (name, app_label, model) VALUES ('KB Forum Thread', 'kbforums', 'thread'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES - ('Can add KB threads', @ct, 'add_thread'), - ('Can lock KB threads', @ct, 'lock_thread'), - ('Can sticky KB threads', @ct, 'sticky_thread'), - ('Can change KB threads', @ct, 'change_thread'), - ('Can delete KB threads', @ct, 'delete_thread'); - -INSERT INTO django_content_type (name, app_label, model) VALUES ('KB Forum Post', 'kbforums', 'post'); -SET @ct = (SELECT LAST_INSERT_ID()); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES - ('Can add KB posts', @ct, 'add_post'), - ('Can change KB posts', @ct, 'change_post'), - ('Can delete KB posts', @ct, 'delete_post'); diff --git a/migrations/51-document-is-localizable.sql b/migrations/51-document-is-localizable.sql deleted file mode 100644 index 49efef811..000000000 --- a/migrations/51-document-is-localizable.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `wiki_document` ADD `is_localizable` tinyint(1) NOT NULL DEFAULT 1; -CREATE INDEX `wiki_document_is_localizable` ON `wiki_document` (`is_template`); diff --git a/migrations/52-article-polls.sql b/migrations/52-article-polls.sql deleted file mode 100644 index 041378c84..000000000 --- a/migrations/52-article-polls.sql +++ /dev/null @@ -1,16 +0,0 @@ -CREATE TABLE `wiki_helpfulvote` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `document_id` integer NOT NULL, - `helpful` bool NOT NULL, - `created` datetime NOT NULL, - `creator_id` integer, - `anonymous_id` varchar(40) NOT NULL, - `user_agent` varchar(1000) NOT NULL -); -ALTER TABLE `wiki_helpfulvote` ADD CONSTRAINT `document_id_refs_id_1ab69a8f` FOREIGN KEY (`document_id`) REFERENCES `wiki_document` (`id`); -ALTER TABLE `wiki_helpfulvote` ADD CONSTRAINT `creator_id_refs_id_b1375de5` FOREIGN KEY (`creator_id`) REFERENCES `auth_user` (`id`); - -CREATE INDEX `wiki_helpfulvote_f4226d13` ON `wiki_helpfulvote` (`document_id`); -CREATE INDEX `wiki_helpfulvote_3216ff68` ON `wiki_helpfulvote` (`created`); -CREATE INDEX `wiki_helpfulvote_f97a5119` ON `wiki_helpfulvote` (`creator_id`); -CREATE INDEX `wiki_helpfulvote_2291b592` ON `wiki_helpfulvote` (`anonymous_id`); diff --git a/migrations/53-fix-is-localizable.sql b/migrations/53-fix-is-localizable.sql deleted file mode 100644 index df87000fa..000000000 --- a/migrations/53-fix-is-localizable.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Put the is_localizable index on is_localizable. -ALTER TABLE `wiki_document` DROP INDEX `wiki_document_is_localizable`; -ALTER TABLE `wiki_document` ADD INDEX `wiki_document_is_localizable` ( `is_localizable` ); diff --git a/migrations/54-wiki-metadata-unique.sql b/migrations/54-wiki-metadata-unique.sql deleted file mode 100644 index ed469fa4a..000000000 --- a/migrations/54-wiki-metadata-unique.sql +++ /dev/null @@ -1,8 +0,0 @@ -ALTER TABLE `wiki_firefoxversion` - DROP INDEX `wiki_firefoxversion_67b70d25`; -ALTER TABLE `wiki_firefoxversion` - ADD UNIQUE (`item_id`, `document_id`); -ALTER TABLE `wiki_operatingsystem` - DROP INDEX `wiki_operatingsystem_67b70d25`; -ALTER TABLE `wiki_operatingsystem` - ADD UNIQUE (`item_id`, `document_id`); diff --git a/migrations/55-latin1-tables.sql b/migrations/55-latin1-tables.sql deleted file mode 100644 index 92d7e8b8b..000000000 --- a/migrations/55-latin1-tables.sql +++ /dev/null @@ -1,70 +0,0 @@ --- blob it -ALTER TABLE `upload_imageattachment` - MODIFY COLUMN `file` blob -, MODIFY COLUMN `thumbnail` blob; --- utf8 it -ALTER TABLE `upload_imageattachment` - MODIFY COLUMN `file` varchar(250) CHARACTER SET utf8 -, MODIFY COLUMN `thumbnail` varchar(250) CHARACTER SET utf8; - -ALTER TABLE `upload_imageattachment` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; - - --- blob it -ALTER TABLE `flagit_flaggedobject` - MODIFY COLUMN `reason` blob -, MODIFY COLUMN `notes` blob; --- utf8 it -ALTER TABLE `flagit_flaggedobject` - MODIFY COLUMN `reason` varchar(64) CHARACTER SET utf8 -, MODIFY COLUMN `notes` longtext CHARACTER SET utf8; - -ALTER TABLE `flagit_flaggedobject` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; - - --- blob it -ALTER TABLE `customercare_cannedcategory` - MODIFY COLUMN `title` blob; --- utf8 it -ALTER TABLE `customercare_cannedcategory` - MODIFY COLUMN `title` varchar(255) CHARACTER SET utf8; - -ALTER TABLE `customercare_cannedcategory` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; - - --- blob it -ALTER TABLE `customercare_cannedresponse` - MODIFY COLUMN `title` blob, - MODIFY COLUMN `response` blob; --- utf8 it -ALTER TABLE `customercare_cannedresponse` - MODIFY COLUMN `title` varchar(255) CHARACTER SET utf8, - MODIFY COLUMN `response` varchar(140) CHARACTER SET utf8; - -ALTER TABLE `customercare_cannedresponse` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; - - -ALTER TABLE `customercare_categorymembership` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; - - -ALTER TABLE `customercare_tweet` DROP INDEX `customercare_tweet_928541cb`; - --- blob it -ALTER TABLE `customercare_tweet` - MODIFY COLUMN `raw_json` blob, - MODIFY COLUMN `locale` blob; --- utf8 it -ALTER TABLE `customercare_tweet` - MODIFY COLUMN `raw_json` longtext CHARACTER SET utf8, - MODIFY COLUMN `locale` varchar(20) CHARACTER SET utf8; - -ALTER TABLE `customercare_tweet` - ADD INDEX `customercare_tweet_928541cb` (`locale`); - -ALTER TABLE `customercare_tweet` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; diff --git a/migrations/56-filename-length-gallery.sql b/migrations/56-filename-length-gallery.sql deleted file mode 100644 index 0faf6a0d1..000000000 --- a/migrations/56-filename-length-gallery.sql +++ /dev/null @@ -1,11 +0,0 @@ --- Extend the length of the filename columns to 250 - -ALTER TABLE `gallery_video` - MODIFY COLUMN `thumbnail` varchar(250), - MODIFY COLUMN `webm` varchar(250), - MODIFY COLUMN `flv` varchar(250), - MODIFY COLUMN `ogv` varchar(250); - -ALTER TABLE `gallery_image` - MODIFY COLUMN `file` varchar(250), - MODIFY COLUMN `thumbnail` varchar(250); diff --git a/migrations/57-related-documents.sql b/migrations/57-related-documents.sql deleted file mode 100644 index 512b4bb88..000000000 --- a/migrations/57-related-documents.sql +++ /dev/null @@ -1,12 +0,0 @@ --- Create RelatedDocument table and some helpful indexes. - -CREATE TABLE `wiki_relateddocument` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `document_id` integer NOT NULL, - `related_id` integer NOT NULL, - `in_common` integer NOT NULL -) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci; - -ALTER TABLE `wiki_relateddocument` ADD CONSTRAINT `document_id_refs_id_5206177f` FOREIGN KEY (`document_id`) REFERENCES `wiki_document` (`id`); -ALTER TABLE `wiki_relateddocument` ADD CONSTRAINT `related_id_refs_id_5206177f` FOREIGN KEY (`related_id`) REFERENCES `wiki_document` (`id`); -CREATE INDEX `wiki_document_34876983` ON `wiki_document` (`category`); diff --git a/migrations/58-kbforum-charsets.sql b/migrations/58-kbforum-charsets.sql deleted file mode 100644 index 3483c8a3c..000000000 --- a/migrations/58-kbforum-charsets.sql +++ /dev/null @@ -1,19 +0,0 @@ --- kbforums_post -ALTER TABLE `kbforums_post` - MODIFY COLUMN `content` BLOB; -ALTER TABLE `kbforums_post` - MODIFY COLUMN `content` LONGTEXT CHARACTER SET utf8 NOT NULL; -ALTER TABLE `kbforums_post` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; -ALTER TABLE `kbforums_post` - ENGINE=InnoDB; - --- kbforums_thread -ALTER TABLE `kbforums_thread` - MODIFY COLUMN `title` BLOB; -ALTER TABLE `kbforums_thread` - MODIFY COLUMN `title` VARCHAR(255) CHARACTER SET utf8 NOT NULL; -ALTER TABLE `kbforums_thread` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; -ALTER TABLE `kbforums_thread` - ENGINE=InnoDB; diff --git a/migrations/59-gallery-permissions.sql b/migrations/59-gallery-permissions.sql deleted file mode 100644 index 9397342fc..000000000 --- a/migrations/59-gallery-permissions.sql +++ /dev/null @@ -1,29 +0,0 @@ --- Permission for deleting media -INSERT INTO django_content_type (name, app_label, model) VALUES - ('Gallery Video', 'gallery', 'video'), - ('Gallery Image', 'gallery', 'image'); -INSERT INTO auth_permission (name, content_type_id, codename) VALUES - ('Can add image', - (SELECT id FROM django_content_type - WHERE app_label='gallery' AND model='image'), - 'add_image'), - ('Can change image', - (SELECT id FROM django_content_type - WHERE app_label='gallery' AND model='image'), - 'change_image'), - ('Can delete image', - (SELECT id FROM django_content_type - WHERE app_label='gallery' AND model='image'), - 'delete_image'), - ('Can add video', - (SELECT id FROM django_content_type - WHERE app_label='gallery' AND model='video'), - 'add_video'), - ('Can change video', - (SELECT id FROM django_content_type - WHERE app_label='gallery' AND model='video'), - 'change_video'), - ('Can delete video', - (SELECT id FROM django_content_type - WHERE app_label='gallery' AND model='video'), - 'delete_video'); diff --git a/migrations/60-helpfulvote-charset.sql b/migrations/60-helpfulvote-charset.sql deleted file mode 100644 index 2e92aae40..000000000 --- a/migrations/60-helpfulvote-charset.sql +++ /dev/null @@ -1,21 +0,0 @@ --- Fix the charset and engine of wiki_helpfulvote. - -ALTER TABLE `wiki_helpfulvote` - DROP INDEX `wiki_helpfulvote_2291b592`; - -ALTER TABLE `wiki_helpfulvote` - MODIFY COLUMN `anonymous_id` BLOB, - MODIFY COLUMN `user_agent` BLOB; - -ALTER TABLE `wiki_helpfulvote` - MODIFY COLUMN `anonymous_id` VARCHAR(40) CHARACTER SET utf8 NOT NULL, - MODIFY COLUMN `user_agent` VARCHAR(1000) CHARACTER SET utf8 NOT NULL; - -ALTER TABLE `wiki_helpfulvote` - CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci; - -ALTER TABLE `wiki_helpfulvote` - ENGINE=InnoDB; - -ALTER TABLE `wiki_helpfulvote` - ADD INDEX `wiki_helpfulvote_2291b592` ( `anonymous_id` ); diff --git a/migrations/61-approvers.sql b/migrations/61-approvers.sql deleted file mode 100644 index 421a00578..000000000 --- a/migrations/61-approvers.sql +++ /dev/null @@ -1,11 +0,0 @@ -INSERT IGNORE INTO auth_group(id, name) - VALUES (NULL, 'Reviewers'); - -INSERT IGNORE INTO auth_user_groups (id, user_id, group_id) - SELECT NULL, users_users.userId, ( - SELECT id FROM auth_group - WHERE name = 'Reviewers' - ) - FROM users_users, users_usergroups - WHERE users_users.userId = users_usergroups.userId - AND users_usergroups.groupName = 'Approvers'; diff --git a/migrations/62-customercare-replies.sql b/migrations/62-customercare-replies.sql deleted file mode 100644 index eb2c74aba..000000000 --- a/migrations/62-customercare-replies.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE `customercare_tweet` ADD `reply_to` BIGINT NULL DEFAULT NULL ; -ALTER TABLE `customercare_tweet` ADD INDEX ( `reply_to` ) ; diff --git a/migrations/63-migrate-tiki-passwords.sql b/migrations/63-migrate-tiki-passwords.sql deleted file mode 100644 index 458367515..000000000 --- a/migrations/63-migrate-tiki-passwords.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Set user passwords from Tiki. -UPDATE auth_user a SET password = (SELECT hash FROM users_users u WHERE u.userId = a.id); diff --git a/migrations/64-user-profile.sql b/migrations/64-user-profile.sql deleted file mode 100644 index 8abc9a6b1..000000000 --- a/migrations/64-user-profile.sql +++ /dev/null @@ -1,17 +0,0 @@ -CREATE TABLE `users_profile` ( - `user_id` int(11) NOT NULL, - `name` varchar(255) NOT NULL, - `public_email` tinyint(1) NOT NULL, - `avatar` varchar(250) DEFAULT NULL, - `bio` longtext, - `website` varchar(255) DEFAULT NULL, - `twitter` varchar(255) DEFAULT NULL, - `facebook` varchar(255) DEFAULT NULL, - `irc_handle` varchar(255) DEFAULT NULL, - `timezone` varchar(100) DEFAULT NULL, - `country` varchar(2) DEFAULT NULL, - `city` varchar(255) DEFAULT NULL, - `livechat_id` varchar(255) DEFAULT NULL, - PRIMARY KEY (`user_id`), - CONSTRAINT `user_id_refs_id_21617f27` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/migrations/65-registration-profile.sql b/migrations/65-registration-profile.sql deleted file mode 100644 index 6bcc46465..000000000 --- a/migrations/65-registration-profile.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE `users_registrationprofile` ( - `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY, - `user_id` integer NOT NULL UNIQUE, - `activation_key` varchar(40) NOT NULL -); -ALTER TABLE `users_registrationprofile` ADD CONSTRAINT `user_id_refs_id_e9e30776` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`); diff --git a/migrations/66-no-required-name.sql b/migrations/66-no-required-name.sql deleted file mode 100644 index 29691f60f..000000000 --- a/migrations/66-no-required-name.sql +++ /dev/null @@ -1,3 +0,0 @@ --- Display or nickname isn't required. -ALTER TABLE `users_profile` - MODIFY `name` varchar(255); diff --git a/migrations/67-redirects-unlocalizable.sql b/migrations/67-redirects-unlocalizable.sql deleted file mode 100644 index 408384cba..000000000 --- a/migrations/67-redirects-unlocalizable.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE wiki_document SET is_localizable=FALSE WHERE html LIKE '

REDIRECT