Fixing up our migrations to match reality and run with no issues.

This commit is contained in:
James Socol 2010-06-07 17:51:21 -07:00
Родитель dc170128df
Коммит 572ed80ae3
4 изменённых файлов: 20 добавлений и 27 удалений

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

@ -1,24 +0,0 @@
BEGIN;
-- Application: forums
-- Model: Forum
ALTER TABLE `forums_forum`
MODIFY `id` integer AUTO_INCREMENT;
ALTER TABLE `forums_forum`
MODIFY `name` varchar(50);
ALTER TABLE `forums_forum`
MODIFY `slug` varchar(50);
-- Model: Thread
ALTER TABLE `forums_thread`
ADD `is_sticky` bool;
CREATE INDEX `forums_thread_is_sticky_idx`
ON `forums_thread` (`is_sticky`);
ALTER TABLE `forums_thread`
MODIFY `is_locked` bool;
ALTER TABLE `forums_thread`
MODIFY `id` integer AUTO_INCREMENT;
ALTER TABLE `forums_thread`
MODIFY `title` varchar(255);
-- Model: Post
ALTER TABLE `forums_post`
MODIFY `id` integer AUTO_INCREMENT;
COMMIT;

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

@ -0,0 +1,19 @@
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;

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

@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `django_admin_log` (
`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`);

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

@ -1,4 +1,2 @@
ALTER TABLE `forums_thread` DROP FOREIGN KEY `last_post_id_refs_id_3fa89f33`;
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;