wisemapping-open-source/config/database/mysql/v2.0-to-v3.0.sql

59 lines
2.0 KiB
MySQL
Raw Normal View History

2013-03-18 03:19:29 +01:00
CREATE TABLE COLLABORATION_PROPERTIES (
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
starred BOOL NOT NULL DEFAULT 0,
mindmap_properties VARCHAR(512)
CHARACTER SET utf8
)
CHARACTER SET utf8;
2013-03-18 03:19:29 +01:00
DROP TABLE `MINDMAP_NATIVE`;
ALTER TABLE `MINDMAP_COLABORATOR` RENAME TO `COLLABORATION`;
ALTER TABLE `COLABORATOR` RENAME TO `COLLABORATOR`;
2013-03-18 03:19:29 +01:00
ALTER TABLE `MINDMAP` DROP COLUMN `editor_properties`, DROP COLUMN `mindMapNative_id`;
2012-08-26 21:53:33 +02:00
ALTER TABLE `MINDMAP` CHANGE COLUMN `owner_id` `creator_id` INT(11) NOT NULL
, DROP INDEX `owner_id`
2013-03-18 03:19:29 +01:00
, ADD INDEX `owner_id` (`creator_id` ASC);
2012-08-26 20:36:08 +02:00
2013-03-18 03:19:29 +01:00
ALTER TABLE `COLLABORATION` ADD COLUMN `properties_id` INT(11) NULL DEFAULT NULL
AFTER `role_id`;
2012-06-23 21:15:59 +02:00
DROP TABLE USER_LOGIN;
CREATE TABLE ACCESS_AUDITORY (
2013-03-18 03:19:29 +01:00
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
user_id INTEGER NOT NULL,
login_date DATE
)
CHARACTER SET utf8;
2012-06-23 21:15:59 +02:00
2012-08-26 20:36:08 +02:00
#ALTER TABLE ACCESS_AUDITORY
# ADD CONSTRAINT `user_id`
# FOREIGN KEY ()
2012-08-26 21:53:33 +02:00
# REFERENCES `USER` ()
2012-08-26 20:36:08 +02:00
# ON DELETE CASCADE
# ON UPDATE NO ACTION
#, ADD INDEX `user_id` () ;
2012-06-23 21:15:59 +02:00
2013-03-18 03:19:29 +01:00
ALTER TABLE `MINDMAP_HISTORY` DROP COLUMN `creator_user`, ADD COLUMN `editor_id` INT(11) NULL DEFAULT NULL
AFTER `creation_date`;
2012-06-23 21:15:59 +02:00
2013-03-18 03:19:29 +01:00
ALTER TABLE `USER` ADD COLUMN `locale` VARCHAR(5) NULL
AFTER `allowSendEmail`;
2012-06-30 07:26:21 +02:00
2013-03-18 03:19:29 +01:00
ALTER TABLE `MINDMAP` DROP COLUMN `last_editor`, ADD COLUMN `last_editor_id` INT(11) NULL DEFAULT 2
AFTER `tags`;
2012-07-15 05:57:44 +02:00
2013-03-18 03:19:29 +01:00
ALTER TABLE `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';
2012-07-15 05:57:44 +02:00
2012-08-26 21:53:33 +02:00
INSERT INTO `MINDMAP` (`last_editor_id`) VALUES (1);
2012-07-15 05:57:44 +02:00
2012-08-26 21:53:33 +02:00
INSERT INTO `COLLABORATOR` (`id`, `email`, `creation_date`) VALUES (8081, 'migfake@wis.com', '2007-10-09');
2013-03-18 03:19:29 +01:00
DELETE FROM `USER`
WHERE activation_date IS null;
2012-08-26 20:36:08 +02:00
DROP TABLE FEEDBACK;
2012-10-01 05:57:49 +02:00
ALTER TABLE `MINDMAP` CHANGE COLUMN `XML` `XML` MEDIUMBLOB NULL DEFAULT NULL;
ALTER TABLE `MINDMAP_HISTORY` CHANGE COLUMN `XML` `XML` MEDIUMBLOB NULL DEFAULT NULL;