From 361beb371fba5f84b83d618356fefe4d06cf6a7e Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 26 Aug 2012 15:36:08 -0300 Subject: [PATCH] - Several fixes --- .../src/test/sql/mysql/v2.0-to-v3.0.sql | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/wise-webapp/src/test/sql/mysql/v2.0-to-v3.0.sql b/wise-webapp/src/test/sql/mysql/v2.0-to-v3.0.sql index 9b8f7267..d8b5fd3d 100644 --- a/wise-webapp/src/test/sql/mysql/v2.0-to-v3.0.sql +++ b/wise-webapp/src/test/sql/mysql/v2.0-to-v3.0.sql @@ -4,16 +4,17 @@ starred BOOL NOT NULL default 0, mindmap_properties varchar(512) CHARACTER SET utf8 ) CHARACTER SET utf8; -drop table `wisemapping`.`MINDMAP_NATIVE` -ALTER TABLE `wisemapping`.`mindmap_colaborator` RENAME TO `wisemapping`.`COLLABORATION` ; -ALTER TABLE `wisemapping`.`colaborator` RENAME TO `wisemapping`.`collaborator` ; +drop table `wisemapping`.`MINDMAP_NATIVE`; +ALTER TABLE `wisemapping`.`MINDMAP_COLABORATOR` RENAME TO `wisemapping`.`COLLABORATION`; +ALTER TABLE `wisemapping`.`COLABORATOR` RENAME TO `wisemapping`.`COLLABORATOR`; -ALTER TABLE `wisemapping`.`mindmap` DROP COLUMN `editor_properties` , DROP COLUMN `mindMapNative_id` ; +ALTER TABLE `wisemapping`.`MINDMAP` DROP COLUMN `editor_properties` , DROP COLUMN `mindMapNative_id` ; -ALTER TABLE `wisemapping`.`mindmap` CHANGE COLUMN `owner_id` `creator_id` INT(11) NOT NULL +ALTER TABLE `wisemapping`.`MINDMAP` CHANGE COLUMN `owner_id` `creator_id` INT(11) NOT NULL , DROP INDEX `owner_id` , ADD INDEX `owner_id` (`creator_id` ASC) ; -ALTER TABLE `wisemapping`.`collaboration` ADD COLUMN `properties_id` INT(11) NULL DEFAULT NULL AFTER `role_id` ; + +ALTER TABLE `wisemapping`.`COLLABORATION` ADD COLUMN `properties_id` INT(11) NULL DEFAULT NULL AFTER `role_id` ; DROP TABLE USER_LOGIN; CREATE TABLE ACCESS_AUDITORY ( @@ -22,24 +23,25 @@ user_id INTEGER NOT NULL, login_date date ) CHARACTER SET utf8 ; -ALTER TABLE ACCESS_AUDITORY - ADD CONSTRAINT `user_id` - FOREIGN KEY () - REFERENCES `wisemapping`.`USER` () - ON DELETE CASCADE - ON UPDATE NO ACTION -, ADD INDEX `user_id` () ; +#ALTER TABLE ACCESS_AUDITORY +# ADD CONSTRAINT `user_id` +# FOREIGN KEY () +# REFERENCES `wisemapping`.`USER` () +# ON DELETE CASCADE +# ON UPDATE NO ACTION +#, ADD INDEX `user_id` () ; -ALTER TABLE `wisemapping`.`mindmap_history` DROP COLUMN `creator_user` , ADD COLUMN `editor_id` INT(11) NULL DEFAULT NULL AFTER `creation_date`; +ALTER TABLE `wisemapping`.`MINDMAP_HISTORY` DROP COLUMN `creator_user` , ADD COLUMN `editor_id` INT(11) NULL DEFAULT NULL AFTER `creation_date`; -ALTER TABLE `wisemapping`.`user` ADD COLUMN `locale` VARCHAR(5) NULL AFTER `allowSendEmail` ; +ALTER TABLE `wisemapping`.`USER` ADD COLUMN `locale` VARCHAR(5) NULL AFTER `allowSendEmail` ; -ALTER TABLE `wisemapping`.`mindmap` DROP COLUMN `last_editor` , ADD COLUMN `last_editor_id` INT(11) NULL DEFAULT NULL AFTER `tags` ; +ALTER TABLE `wisemapping`.`MINDMAP` DROP COLUMN `last_editor` , ADD COLUMN `last_editor_id` INT(11) NULL DEFAULT 9 AFTER `tags` ; -ALTER TABLE `wisemapping2`.`user` DROP COLUMN `username` , CHANGE COLUMN `activationCode` `activation_code` BIGINT(20) NOT NULL , CHANGE COLUMN `allowSendEmail` `allow_send_email` CHAR(1) NOT NULL DEFAULT '0' ; +ALTER TABLE `wisemapping`.`USER` DROP COLUMN `username` , CHANGE COLUMN `activationCode` `activation_code` BIGINT(20) NOT NULL , CHANGE COLUMN `allowSendEmail` `allow_send_email` CHAR(1) NOT NULL DEFAULT '0' ; +INSERT INTO `wisemapping`.`MINDMAP` (`last_editor_id`) VALUES (1); -# INSERT INTO `wisemapping`.`collaborator` (`id`, `email`, `creation_date`) VALUES (8081, 'fake@wisemapping.com', '2007-10-09'); -# DELETE FROM `wisemapping`.`USER` where activation_date is null; -# DROP TABLE FEEDBACK; +INSERT INTO `wisemapping`.`COLLABORATOR` (`id`, `email`, `creation_date`) VALUES (8081, 'migfake@wisemapping.com', '2007-10-09'); +DELETE FROM `wisemapping`.`USER` where activation_date is null; +DROP TABLE FEEDBACK;