Drop old migrations. [bug 634677]

This commit is contained in:
James Socol 2011-02-16 15:08:12 -05:00
Родитель b3ac8df5c4
Коммит f370de8526
83 изменённых файлов: 0 добавлений и 1656 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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 = '';

Просмотреть файл

@ -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');

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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.

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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`);

Просмотреть файл

@ -1,5 +0,0 @@
-- Application: notifications
-- Model: EventWatch
ALTER TABLE `notifications_eventwatch`
ADD `hash` varchar(40);
CREATE INDEX `hash` ON `notifications_eventwatch` (`hash`);

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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`);

Просмотреть файл

@ -1,2 +0,0 @@
CREATE UNIQUE INDEX `questions_questionmetadata_question_and_name_idx`
ON `questions_questionmetadata` (`question_id`, `name`);

Просмотреть файл

@ -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';

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -1,3 +0,0 @@
-- Create an index on taggit_taggeditem.object_id
CREATE INDEX `taggit_taggeditem_c32a93c2` ON `taggit_taggeditem` (`object_id`);

Просмотреть файл

@ -1,8 +0,0 @@
UPDATE
tiki_comments
SET
type = 'l'
WHERE
parentId = 0
AND objectType = 'forum'
AND object = 6;

Просмотреть файл

@ -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');

Просмотреть файл

@ -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'
);

Просмотреть файл

@ -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');

Просмотреть файл

@ -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');

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -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');

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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');

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;

Просмотреть файл

@ -1 +0,0 @@
ALTER TABLE `notifications_eventwatch` MODIFY `watch_id` integer;

Просмотреть файл

@ -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');

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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`;

Просмотреть файл

@ -1 +0,0 @@
ALTER TABLE `wiki_revision` MODIFY `significance` integer;

Просмотреть файл

@ -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`);

Просмотреть файл

@ -1,3 +0,0 @@
-- Add an index on wiki_revision.is_approved
CREATE INDEX `wiki_revision_is_approved_idx`
ON `wiki_revision` (`is_approved`);

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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');

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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` );

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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`);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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');

Просмотреть файл

@ -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` );

Просмотреть файл

@ -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';

Просмотреть файл

@ -1,2 +0,0 @@
ALTER TABLE `customercare_tweet` ADD `reply_to` BIGINT NULL DEFAULT NULL ;
ALTER TABLE `customercare_tweet` ADD INDEX ( `reply_to` ) ;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;

Просмотреть файл

@ -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`);

Просмотреть файл

@ -1,3 +0,0 @@
-- Display or nickname isn't required.
ALTER TABLE `users_profile`
MODIFY `name` varchar(255);

Просмотреть файл

@ -1 +0,0 @@
UPDATE wiki_document SET is_localizable=FALSE WHERE html LIKE '<p>REDIRECT <a %';

Просмотреть файл

@ -1,16 +0,0 @@
ALTER TABLE users_users
MODIFY login varchar(30) COLLATE utf8_unicode_ci;
INSERT IGNORE INTO auth_group(id, name)
VALUES (NULL, 'Live Chat helpers');
INSERT IGNORE INTO auth_user_groups (user_id, group_id)
SELECT auth_user.id, (
SELECT id FROM auth_group
WHERE name = 'Live Chat helpers'
)
FROM auth_user JOIN users_users ON
(auth_user.username = users_users.login),
users_usergroups
WHERE users_users.userId = users_usergroups.userId
AND users_usergroups.groupName = 'Live Chat helpers';

Просмотреть файл

@ -1,7 +0,0 @@
ALTER TABLE customercare_cannedcategory ENGINE=InnoDB;
ALTER TABLE customercare_cannedresponse ENGINE=InnoDB;
ALTER TABLE customercare_categorymembership ENGINE=InnoDB;
ALTER TABLE customercare_tweet ENGINE=InnoDB;
ALTER TABLE flagit_flaggedobject ENGINE=InnoDB;
ALTER TABLE schema_version ENGINE=InnoDB;
ALTER TABLE upload_imageattachment ENGINE=InnoDB;

Просмотреть файл

@ -1,241 +0,0 @@
-- tiki_%
DROP TABLE tiki_actionlog;
DROP TABLE tiki_actionlog_conf;
DROP TABLE tiki_actionlog_params;
DROP TABLE tiki_article_types;
DROP TABLE tiki_articles;
DROP TABLE tiki_banners;
DROP TABLE tiki_banning;
DROP TABLE tiki_banning_sections;
DROP TABLE tiki_blog_activity;
DROP TABLE tiki_blog_posts;
DROP TABLE tiki_blog_posts_images;
DROP TABLE tiki_blogs;
DROP TABLE tiki_calendar_categories;
DROP TABLE tiki_calendar_items;
DROP TABLE tiki_calendar_locations;
DROP TABLE tiki_calendar_options;
DROP TABLE tiki_calendar_roles;
DROP TABLE tiki_calendars;
DROP TABLE tiki_categories;
DROP TABLE tiki_categorized_objects;
DROP TABLE tiki_category_objects;
DROP TABLE tiki_category_sites;
DROP TABLE tiki_chart_items;
DROP TABLE tiki_charts;
DROP TABLE tiki_charts_rankings;
DROP TABLE tiki_charts_votes;
DROP TABLE tiki_chat_channels;
DROP TABLE tiki_chat_messages;
DROP TABLE tiki_chat_users;
DROP TABLE tiki_comments;
DROP TABLE tiki_comments_metadata;
DROP TABLE tiki_content;
DROP TABLE tiki_content_templates;
DROP TABLE tiki_content_templates_sections;
DROP TABLE tiki_contributions;
DROP TABLE tiki_contributions_assigned;
DROP TABLE tiki_cookies;
DROP TABLE tiki_copyrights;
DROP TABLE tiki_directory_categories;
DROP TABLE tiki_directory_search;
DROP TABLE tiki_directory_sites;
DROP TABLE tiki_download;
DROP TABLE tiki_drawings;
DROP TABLE tiki_dsn;
DROP TABLE tiki_dynamic_variables;
DROP TABLE tiki_eph;
DROP TABLE tiki_events;
DROP TABLE tiki_extwiki;
DROP TABLE tiki_faq_questions;
DROP TABLE tiki_faqs;
DROP TABLE tiki_featured_links;
DROP TABLE tiki_file_galleries;
DROP TABLE tiki_file_handlers;
DROP TABLE tiki_files;
DROP TABLE tiki_forum_attachments;
DROP TABLE tiki_forum_reads;
DROP TABLE tiki_forums;
DROP TABLE tiki_forums_queue;
DROP TABLE tiki_forums_reported;
DROP TABLE tiki_freetagged_objects;
DROP TABLE tiki_freetags;
DROP TABLE tiki_friends;
DROP TABLE tiki_friendship_requests;
DROP TABLE tiki_galleries;
DROP TABLE tiki_galleries_scales;
DROP TABLE tiki_games;
DROP TABLE tiki_group_inclusion;
DROP TABLE tiki_history;
DROP TABLE tiki_hotwords;
DROP TABLE tiki_html_pages;
DROP TABLE tiki_html_pages_dynamic_zones;
DROP TABLE tiki_images;
DROP TABLE tiki_images_data;
DROP TABLE tiki_integrator_reps;
DROP TABLE tiki_integrator_rules;
DROP TABLE tiki_language;
DROP TABLE tiki_languages;
DROP TABLE tiki_link_cache;
DROP TABLE tiki_links;
DROP TABLE tiki_live_support_events;
DROP TABLE tiki_live_support_message_comments;
DROP TABLE tiki_live_support_messages;
DROP TABLE tiki_live_support_modules;
DROP TABLE tiki_live_support_operators;
DROP TABLE tiki_live_support_requests;
DROP TABLE tiki_logs;
DROP TABLE tiki_mail_events;
DROP TABLE tiki_mailin_accounts;
DROP TABLE tiki_menu_languages;
DROP TABLE tiki_menu_options;
DROP TABLE tiki_menus;
DROP TABLE tiki_minical_events;
DROP TABLE tiki_minical_topics;
DROP TABLE tiki_modules;
DROP TABLE tiki_mypage;
DROP TABLE tiki_mypage_types;
DROP TABLE tiki_mypage_types_components;
DROP TABLE tiki_mypagewin;
DROP TABLE tiki_newsletter_groups;
DROP TABLE tiki_newsletter_included;
DROP TABLE tiki_newsletter_subscriptions;
DROP TABLE tiki_newsletters;
DROP TABLE tiki_newsreader_marks;
DROP TABLE tiki_newsreader_servers;
DROP TABLE tiki_object_ratings;
DROP TABLE tiki_objects;
DROP TABLE tiki_page_drafts;
DROP TABLE tiki_page_footnotes;
DROP TABLE tiki_page_list_types;
DROP TABLE tiki_page_lists;
DROP TABLE tiki_pages;
DROP TABLE tiki_pages_translation_bits;
DROP TABLE tiki_pageviews;
DROP TABLE tiki_poll_objects;
DROP TABLE tiki_poll_options;
DROP TABLE tiki_poll_questions;
DROP TABLE tiki_poll_votes;
DROP TABLE tiki_polls;
DROP TABLE tiki_preferences;
DROP TABLE tiki_private_messages;
DROP TABLE tiki_programmed_content;
DROP TABLE tiki_question_fields;
DROP TABLE tiki_question_sections;
DROP TABLE tiki_quicktags;
DROP TABLE tiki_quiz_question_options;
DROP TABLE tiki_quiz_questions;
DROP TABLE tiki_quiz_results;
DROP TABLE tiki_quiz_stats;
DROP TABLE tiki_quiz_stats_sum;
DROP TABLE tiki_quizzes;
DROP TABLE tiki_received_articles;
DROP TABLE tiki_received_pages;
DROP TABLE tiki_referer_stats;
DROP TABLE tiki_registration_fields;
DROP TABLE tiki_related_categories;
DROP TABLE tiki_rss_feeds;
DROP TABLE tiki_rss_modules;
DROP TABLE tiki_score;
DROP TABLE tiki_search_stats;
DROP TABLE tiki_searchindex;
DROP TABLE tiki_searchsyllable;
DROP TABLE tiki_searchwords;
DROP TABLE tiki_secdb;
DROP TABLE tiki_semaphores;
DROP TABLE tiki_sent_newsletters;
DROP TABLE tiki_sent_newsletters_errors;
DROP TABLE tiki_sessions;
DROP TABLE tiki_sheet_layout;
DROP TABLE tiki_sheet_values;
DROP TABLE tiki_sheets;
DROP TABLE tiki_shoutbox;
DROP TABLE tiki_shoutbox_words;
DROP TABLE tiki_stats;
DROP TABLE tiki_structure_versions;
DROP TABLE tiki_structures;
DROP TABLE tiki_submissions;
DROP TABLE tiki_suggested_faq_questions;
DROP TABLE tiki_survey_question_options;
DROP TABLE tiki_survey_questions;
DROP TABLE tiki_surveys;
DROP TABLE tiki_tags;
DROP TABLE tiki_theme_control_categs;
DROP TABLE tiki_theme_control_objects;
DROP TABLE tiki_theme_control_sections;
DROP TABLE tiki_topics;
DROP TABLE tiki_tracker_fields;
DROP TABLE tiki_tracker_item_attachments;
DROP TABLE tiki_tracker_item_comments;
DROP TABLE tiki_tracker_item_fields;
DROP TABLE tiki_tracker_items;
DROP TABLE tiki_tracker_options;
DROP TABLE tiki_trackers;
DROP TABLE tiki_translated_objects;
DROP TABLE tiki_untranslated;
DROP TABLE tiki_urlt_config;
DROP TABLE tiki_urlt_regex_in;
DROP TABLE tiki_urlt_regex_out;
DROP TABLE tiki_user_answers;
DROP TABLE tiki_user_answers_uploads;
DROP TABLE tiki_user_assigned_modules;
DROP TABLE tiki_user_bookmarks_folders;
DROP TABLE tiki_user_bookmarks_urls;
DROP TABLE tiki_user_mail_accounts;
DROP TABLE tiki_user_menus;
DROP TABLE tiki_user_modules;
DROP TABLE tiki_user_notes;
DROP TABLE tiki_user_postings;
DROP TABLE tiki_user_preferences;
DROP TABLE tiki_user_quizzes;
DROP TABLE tiki_user_taken_quizzes;
DROP TABLE tiki_user_tasks;
DROP TABLE tiki_user_tasks_history;
DROP TABLE tiki_user_votings;
DROP TABLE tiki_user_watches;
DROP TABLE tiki_userfiles;
DROP TABLE tiki_userpoints;
DROP TABLE tiki_users;
DROP TABLE tiki_users_score;
DROP TABLE tiki_webmail_contacts;
DROP TABLE tiki_webmail_contacts_ext;
DROP TABLE tiki_webmail_contacts_fields;
DROP TABLE tiki_webmail_contacts_groups;
DROP TABLE tiki_webmail_messages;
DROP TABLE tiki_wiki_attachments;
DROP TABLE tiki_zones;
-- Events
DROP TABLE events_event;
DROP TABLE events_signup;
-- Galaxia
DROP TABLE galaxia_activities;
DROP TABLE galaxia_activity_roles;
DROP TABLE galaxia_instance_activities;
DROP TABLE galaxia_instance_comments;
DROP TABLE galaxia_instances;
DROP TABLE galaxia_processes;
DROP TABLE galaxia_roles;
DROP TABLE galaxia_transitions;
DROP TABLE galaxia_user_roles;
DROP TABLE galaxia_workitems;
-- Users (excluding users_profile)
DROP TABLE users_grouppermissions;
DROP TABLE users_groups;
DROP TABLE users_objectpermissions;
DROP TABLE users_permissions;
DROP TABLE users_usergroups;
DROP TABLE users_users;
-- Others
DROP TABLE adodb_logsql;
DROP TABLE messu_archive;
DROP TABLE messu_messages;
DROP TABLE messu_sent;
DROP TABLE metrics_assigned;
DROP TABLE metrics_metric;
DROP TABLE metrics_tab;
DROP TABLE se_weights;
DROP TABLE sessions;

Просмотреть файл

@ -1,11 +0,0 @@
CREATE TABLE `users_emailchange` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`user_id` integer NOT NULL UNIQUE,
`activation_key` varchar(40) NOT NULL,
`email` varchar(75)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `users_emailchange`
ADD CONSTRAINT `user_id_refs_id_7c0fddb0` FOREIGN KEY (`user_id`)
REFERENCES `auth_user` (`id`);
CREATE INDEX `users_emailchange_email`
ON `users_emailchange` (`email`);

Просмотреть файл

@ -1,2 +0,0 @@
ALTER TABLE `gallery_video`
ADD `poster` varchar(250) DEFAULT NULL;

Просмотреть файл

@ -1,10 +0,0 @@
CREATE TABLE `dashboards_wikidocumentvisits` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`document_id` integer NOT NULL,
`visits` integer NOT NULL,
`period` integer NOT NULL,
UNIQUE (`period`, `document_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `dashboards_wikidocumentvisits` ADD CONSTRAINT `document_id_refs_id_814b8dd0` FOREIGN KEY (`document_id`) REFERENCES `wiki_document` (`id`);
CREATE INDEX `dashboards_wikidocumentvisits_f4226d13` ON `dashboards_wikidocumentvisits` (`document_id`);
CREATE INDEX `dashboards_wikidocumentvisits_5bfc8463` ON `dashboards_wikidocumentvisits` (`visits`);

Просмотреть файл

@ -1,7 +0,0 @@
-- Remove old, insecure password hashes.
UPDATE
auth_user
SET
password = 'PASSWORD_DISABLED'
WHERE
password NOT LIKE 'sha%';

Просмотреть файл

@ -1,13 +0,0 @@
ALTER TABLE `customercare_cannedcategory`
ADD `locale` varchar(7) NOT NULL DEFAULT 'en-US';
ALTER TABLE `customercare_cannedresponse`
ADD `locale` varchar(7) NOT NULL DEFAULT 'en-US';
CREATE INDEX `customercare_cannedcategory_928541cb`
ON `customercare_cannedcategory` (`locale`);
CREATE INDEX `customercare_cannedresponse_928541cb`
ON `customercare_cannedresponse` (`locale`);
ALTER TABLE `customercare_cannedcategory`
ADD UNIQUE (`title`, `locale`);
ALTER TABLE `customercare_cannedresponse`
ADD UNIQUE (`title`, `locale`);

Просмотреть файл

@ -1,16 +0,0 @@
CREATE TABLE `inproduct_redirect` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`product` varchar(30) NOT NULL,
`version` varchar(30) NOT NULL,
`platform` varchar(30) NOT NULL,
`locale` varchar(10) NOT NULL,
`topic` varchar(50) NOT NULL,
`target` varchar(100) NOT NULL,
UNIQUE (`product`, `version`, `platform`, `locale`, `topic`)
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE INDEX `inproduct_redirect_81e0dea9` ON `inproduct_redirect` (`product`);
CREATE INDEX `inproduct_redirect_659105e4` ON `inproduct_redirect` (`version`);
CREATE INDEX `inproduct_redirect_eab31616` ON `inproduct_redirect` (`platform`);
CREATE INDEX `inproduct_redirect_928541cb` ON `inproduct_redirect` (`locale`);
CREATE INDEX `inproduct_redirect_277e394d` ON `inproduct_redirect` (`topic`);

Просмотреть файл

@ -1,38 +0,0 @@
INSERT INTO inproduct_redirect
(product, version, platform, locale, topic, target)
VALUES
('mobile', '', '', '', '', 'http://www.mozilla.com/m/support'),
('mobile', '', '', '', 'firefox-help', 'http://www.mozilla.com/m/support'),
('', '', 'iPhone', '', '', 'kb/What is Firefox Home'),
('', '', '', '', '', 'home'),
('', '', 'iPhone', '', 'install', 'kb/How to set up Firefox Home'),
('', '', '', '', 'pageinfo_general', 'kb/Page Info window'),
('', '', '', '', 'pageinfo_media', 'kb/Page Info window#Media'),
('', '', '', '', 'pageinfo_feed', 'kb/Page Info window#Feeds'),
('', '', '', '', 'pageinfo_permissions', 'kb/Page Info window#Permissions'),
('', '', '', '', 'pageinfo_security', 'kb/Page Info window#Security'),
('', '', '', '', 'prefs-weave', 'kb/How to sync Firefox settings between computers'),
('', '', '', '', 'plugin-crashed', 'kb/Plugin crash reports'),
('', '', '', '', 'firefox-help', 'home'),
('', '', '', '', 'firefox-f1', 'home'),
('', '', '', '', 'firefox-osxkey', 'home'),
('', '', '', '', 'keyboard-shortcuts', 'kb/Keyboard shortcuts'),
('', '', '', '', 'prefs-main', 'kb/Options window - General panel'),
('', '', '', '', 'prefs-clear-private-data', 'kb/Clear Recent History'),
('', '', '', '', 'prefs-fonts-and-colors', 'kb/Options window - Content panel#fonts_and_colors'),
('', '', '', '', 'prefs-privacy', 'kb/Options window - Privacy panel'),
('', '', '', '', 'prefs-applications', 'kb/Options window - Applications panel'),
('', '', '', '', 'prefs-connection-settings', 'kb/Options window - Advanced panel#connection_settings'),
('', '', '', '', 'prefs-tabs', 'kb/Options window - Tabs panel'),
('', '', '', '', 'prefs-advanced-javascript', 'kb/Options window - Content panel'),
('', '', '', '', 'prefs-languages', 'kb/Options window - Content panel#languages'),
('', '', '', '', 'prefs-content', 'kb/Options window - Content panel'),
('', '', '', '', 'prefs-security', 'kb/Options window - Security panel'),
('', '', '', '', 'prefs-advanced-general', 'kb/Options window - Advanced panel'),
('', '', '', '', 'prefs-advanced-network', 'kb/Options window - Advanced panel#advanced_network'),
('', '', '', '', 'prefs-advanced-update', 'kb/Options window - Advanced panel#advanced_update'),
('', '', '', '', 'prefs-advanced-encryption', 'kb/Options window - Advanced panel#advanced_encryption'),
('', '', '', '', 'ieusers', 'kb/Windows start page'),
('', '', '', '', 'places-locked', 'kb/The bookmarks and history system will not be functional'),
('', '', '', '', 'private-browsing', 'kb/Private Browsing'),
('firefox-home', '', 'iPhone', '', 'log-in', 'kb/Cannot log in to Firefox Home App');

Просмотреть файл

@ -1,29 +0,0 @@
CREATE TABLE `notifications_watch` (
`id` integer NOT NULL AUTO_INCREMENT,
`event_type` varchar(30) binary NOT NULL,
`content_type_id` integer DEFAULT NULL,
`object_id` integer unsigned DEFAULT NULL,
`user_id` integer DEFAULT NULL,
`email` varchar(75) DEFAULT NULL,
`secret` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `notifications_watch_2be07fce` (`event_type`),
KEY `notifications_watch_e4470c6e` (`content_type_id`),
KEY `notifications_watch_829e37fd` (`object_id`),
KEY `notifications_watch_fbfc09f1` (`user_id`),
KEY `notifications_watch_3904588a` (`email`),
CONSTRAINT `content_type_id_refs_id_23da5933` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`),
CONSTRAINT `user_id_refs_id_2dc6eef1` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `notifications_watchfilter` (
`id` integer NOT NULL AUTO_INCREMENT,
`watch_id` integer NOT NULL,
`name` binary(20) NOT NULL,
`value` integer UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
UNIQUE (`name`, `watch_id`),
KEY `notifications_watchfilter_6e1bd094` (`watch_id`),
CONSTRAINT `watch_id_refs_id_444d6e79` FOREIGN KEY (`watch_id`) REFERENCES `notifications_watch` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Просмотреть файл

@ -1,9 +0,0 @@
-- secret doesn't need to be a varchar:
ALTER TABLE notifications_watch MODIFY secret char(10);
-- Make event_type case sensitive:
ALTER TABLE notifications_watch MODIFY event_type varchar(30) CHARACTER SET ascii COLLATE ascii_bin NOT NULL;
-- name should be a varchar (and was meant to be); otherwise, MySQL pads it out
-- with nulls, and equality comparisons all fail.
ALTER TABLE notifications_watchfilter MODIFY name varchar(20) CHARACTER SET ascii COLLATE ascii_bin NOT NULL;

Просмотреть файл

@ -1,4 +0,0 @@
ALTER TABLE `notifications_watch`
ADD `is_active` tinyint(1) NOT NULL DEFAULT 0;
CREATE INDEX `notifications_watch_2d27166b`
ON `notifications_watch` (`is_active`);

Просмотреть файл

@ -1,41 +0,0 @@
-- Translation revisions that were migrated rather than created in the new
-- system have no based_on IDs, so the dashboard doesn't know where to start
-- looking for [major or minor] changes in the English article.
-- Set the based_on of the first revision of each translation to the first
-- revision of the English if the based_on was NULL.
-- MySQL can't update the same table that it's doing a subselect from, so use a
-- temp table. :-P
CREATE TEMPORARY TABLE min_english_revisions (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
document_id int REFERENCES wiki_document.id,
revision_id int REFERENCES wiki_revision.id
);
INSERT INTO min_english_revisions (document_id, revision_id) SELECT wiki_document.id, MIN(wiki_revision.id) FROM wiki_revision
INNER JOIN wiki_document ON wiki_document.id=wiki_revision.document_id AND wiki_document.locale='en-US'
GROUP BY wiki_revision.document_id;
UPDATE wiki_revision transrev
INNER JOIN wiki_document transdoc ON transdoc.id=transrev.document_id
INNER JOIN wiki_document engdoc ON engdoc.id=transdoc.parent_id
SET transrev.based_on_id=(
SELECT revision_id
FROM min_english_revisions
WHERE document_id=engdoc.id)
WHERE
transrev.based_on_id IS NULL
AND transdoc.parent_id IS NOT NULL
AND transdoc.locale!='en-US';
-- We actually have 1 English article with a parent!
-- To test, run this before and after. By my reckoning, there should be a bunch
-- beforehand and none afterward.
--
-- SELECT COUNT(*)
-- FROM wiki_revision
-- INNER JOIN wiki_document ON wiki_document.id=wiki_revision.document_id
-- WHERE wiki_document.locale!='en-US'
-- AND wiki_document.parent_id IS NOT NULL
-- AND wiki_revision.based_on_id IS NULL;

Просмотреть файл

@ -1,145 +0,0 @@
-- Migrate watches from the old notifications_eventwatch table to the 2 new ones.
-- Took 2 minutes and 45 seconds for 120K rows on my laptop.
-- First, frob the collation of the email column to hugely speed things up:
ALTER TABLE notifications_watch MODIFY email varchar(75) NOT NULL COLLATE utf8_unicode_ci;
BEGIN; -- MySQL stupidly commits when it hits an ALTER statement.
-- Next, do the filterless watches:
INSERT INTO notifications_watch
(event_type, content_type_id, object_id, is_active, email)
SELECT 'question solved',
content_type_id,
watch_id,
1,
email
FROM notifications_eventwatch
WHERE event_type='solution';
INSERT INTO notifications_watch
(event_type, content_type_id, object_id, is_active, email)
SELECT 'wiki edit document',
content_type_id,
watch_id,
1,
email
FROM notifications_eventwatch
WHERE event_type='edited';
-- 'post' type referring to wiki docs:
INSERT INTO notifications_watch
(event_type, content_type_id, object_id, is_active, email)
SELECT 'kbforum thread',
content_type_id,
watch_id,
1,
email
FROM notifications_eventwatch
WHERE event_type='post' AND content_type_id=(SELECT id from django_content_type where model='document' and app_label='wiki');
-- 'post' type referring to forums:
INSERT INTO notifications_watch
(event_type, content_type_id, object_id, is_active, email)
SELECT 'forum thread',
content_type_id,
watch_id,
1,
email
FROM notifications_eventwatch
WHERE event_type='post' AND content_type_id=(SELECT id from django_content_type where model='forum' and app_label='forums');
-- 'reply' type referring to questions:
INSERT INTO notifications_watch
(event_type, content_type_id, object_id, is_active, email)
SELECT 'question reply',
content_type_id,
watch_id,
1,
email
FROM notifications_eventwatch
WHERE event_type='reply' AND content_type_id=(SELECT id from django_content_type where model='question' and app_label='questions');
-- 'reply' type referring to forum threads:
INSERT INTO notifications_watch
(event_type, content_type_id, object_id, is_active, email)
SELECT 'thread reply',
content_type_id,
watch_id,
1,
email
FROM notifications_eventwatch
WHERE event_type='reply' AND content_type_id=(SELECT id from django_content_type where model='thread' and app_label='forums');
-- 'reply' type referring to kbforums:
INSERT INTO notifications_watch
(event_type, content_type_id, object_id, is_active, email)
SELECT 'kbthread reply',
content_type_id,
watch_id,
1,
email
FROM notifications_eventwatch
WHERE event_type='reply' AND content_type_id=(SELECT id from django_content_type where model='thread' and app_label='kbforums');
-- Migrate watches that in the new system have filters:
-- 'approved' type:
-- We do a little dance where we stick the old watch ID into the object_id
-- column temporarily and use it to find the old watch when inserting the new
-- watchfilter row.
INSERT INTO notifications_watch (event_type, is_active, email, object_id)
SELECT 'approved wiki in locale',
1,
email,
id
FROM notifications_eventwatch
WHERE event_type='approved';
INSERT INTO notifications_watchfilter (watch_id, name, value)
SELECT notifications_watch.id,
'locale',
crc32(notifications_eventwatch.locale)
FROM notifications_watch
INNER JOIN notifications_eventwatch ON notifications_watch.object_id=notifications_eventwatch.id
WHERE notifications_eventwatch.event_type='approved';
UPDATE notifications_watch SET object_id=NULL
WHERE event_type='approved wiki in locale';
-- 'ready_for_review' type:
INSERT INTO notifications_watch (event_type, is_active, email, object_id)
SELECT 'reviewable wiki in locale',
1,
email,
id
FROM notifications_eventwatch
WHERE event_type='ready_for_review';
INSERT INTO notifications_watchfilter (watch_id, name, value)
SELECT notifications_watch.id,
'locale',
crc32(notifications_eventwatch.locale)
FROM notifications_watch
INNER JOIN notifications_eventwatch ON notifications_watch.object_id=notifications_eventwatch.id
WHERE notifications_eventwatch.event_type='ready_for_review';
UPDATE notifications_watch SET object_id=NULL
WHERE event_type='reviewable wiki in locale';
-- Replace the emails with user IDs where they match:
UPDATE notifications_watch INNER JOIN auth_user ON notifications_watch.email=auth_user.email SET notifications_watch.user_id=auth_user.id, notifications_watch.email=NULL;
-- And put the email column's collation back the way we found it:
ALTER TABLE notifications_watch MODIFY email varchar(75) NOT NULL COLLATE utf8_general_ci;
-- Insert random secrets:
UPDATE notifications_watch SET secret=concat(
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)),
char(round(rand() * 25) + (case when round(rand()) then 65 else 97 end)));

Просмотреть файл

@ -1,6 +0,0 @@
-- Oops. Migration 82 made notifications_watch not nullable.
ALTER TABLE notifications_watch MODIFY email varchar(75) COLLATE utf8_general_ci;
-- Migration 82 set email to '' where it should have been NULL:
UPDATE notifications_watch SET email=NULL WHERE email='';