From 02ee11a094f7937ac660916a5ef6bc7841216ad3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 1 Apr 2023 13:42:07 -0700 Subject: [PATCH] Fix issue https://bitbucket.org/wisemapping/wisemapping-open-source/issues/18/mysql-create-schemassql-error --- config/database/hsql/apopulate-schemas.sql | 11 +- config/database/hsql/create-schemas.sql | 91 +------------- config/database/hsql/drop-schemas.sql | 11 +- config/database/mysql/apopulate-schemas.sql | 14 +-- config/database/mysql/create-database.sql | 11 +- config/database/mysql/create-schemas.sql | 129 +------------------- config/database/mysql/drop-schemas.sql | 11 +- 7 files changed, 7 insertions(+), 271 deletions(-) diff --git a/config/database/hsql/apopulate-schemas.sql b/config/database/hsql/apopulate-schemas.sql index 90ad6018..9521e30b 100644 --- a/config/database/hsql/apopulate-schemas.sql +++ b/config/database/hsql/apopulate-schemas.sql @@ -1,10 +1 @@ -INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURDATE()); -INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) - VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1,'D'); - -INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURDATE()); -INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) - VALUES (2, 'Admin', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1,'D'); - -COMMIT; -SHUTDOWN; +INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURDATE()); INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1,'D'); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURDATE()); INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (2, 'Admin', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURDATE(), 1,'D'); COMMIT; SHUTDOWN; \ No newline at end of file diff --git a/config/database/hsql/create-schemas.sql b/config/database/hsql/create-schemas.sql index 2dc4a1bb..3dfd10a3 100644 --- a/config/database/hsql/create-schemas.sql +++ b/config/database/hsql/create-schemas.sql @@ -1,90 +1 @@ -CREATE TABLE COLLABORATOR ( - id INTEGER NOT NULL IDENTITY, - email VARCHAR(255) NOT NULL UNIQUE, - creation_date DATE -); - -CREATE TABLE USER ( - colaborator_id INTEGER NOT NULL IDENTITY, - authentication_type CHAR(1) NOT NULL, - authenticator_uri VARCHAR(255) NULL, - firstname VARCHAR(255) NOT NULL, - lastname VARCHAR(255) NOT NULL, - password VARCHAR(255) NOT NULL, - activation_code BIGINT NOT NULL, - activation_date DATE, - allow_send_email CHAR(1) NOT NULL, - locale VARCHAR(5), - google_sync BOOLEAN, - sync_code VARCHAR(255), - google_token VARCHAR(255), - FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) -); - -CREATE TABLE MINDMAP ( - id INTEGER NOT NULL IDENTITY, - title VARCHAR(255) NOT NULL, - description VARCHAR(255), - xml LONGVARBINARY NOT NULL, - public BOOLEAN NOT NULL, - creation_date DATETIME, - edition_date DATETIME, - creator_id INTEGER NOT NULL, - last_editor_id INTEGER NOT NULL ---FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id) -); - -CREATE TABLE LABEL ( - id INTEGER NOT NULL PRIMARY KEY IDENTITY, - title VARCHAR(30), - creator_id INTEGER NOT NULL, - parent_label_id INTEGER, - color VARCHAR(7) NOT NULL, - iconName VARCHAR(50) NOT NULL - --FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id) -); - -CREATE TABLE R_LABEL_MINDMAP ( - mindmap_id INTEGER NOT NULL, - label_id INTEGER NOT NULL, - PRIMARY KEY (mindmap_id, label_id), - FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id), - FOREIGN KEY (label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION -); - -CREATE TABLE MINDMAP_HISTORY ( - id INTEGER NOT NULL IDENTITY, - xml LONGVARBINARY NOT NULL, - mindmap_id INTEGER NOT NULL, - creation_date DATETIME, - editor_id INTEGER NOT NULL, - FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) -); - -CREATE TABLE COLLABORATION_PROPERTIES ( - id INTEGER NOT NULL IDENTITY, - starred BOOLEAN NOT NULL, - mindmap_properties VARCHAR(512) -); - -CREATE TABLE COLLABORATION ( - id INTEGER NOT NULL IDENTITY, - colaborator_id INTEGER NOT NULL, - properties_id INTEGER NOT NULL, - mindmap_id INTEGER NOT NULL, - role_id INTEGER NOT NULL, - FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id), - FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id), - FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) -); - -CREATE TABLE ACCESS_AUDITORY ( - id INTEGER NOT NULL IDENTITY, - user_id INTEGER NOT NULL, - login_date DATE, - FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) - ON DELETE CASCADE - ON UPDATE NO ACTION -); - -COMMIT; +CREATE TABLE COLLABORATOR ( id INTEGER NOT NULL IDENTITY, email VARCHAR(255) NOT NULL UNIQUE, creation_date DATE ); CREATE TABLE USER ( colaborator_id INTEGER NOT NULL IDENTITY, authentication_type CHAR(1) NOT NULL, authenticator_uri VARCHAR(255) NULL, firstname VARCHAR(255) NOT NULL, lastname VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, activation_code BIGINT NOT NULL, activation_date DATE, allow_send_email CHAR(1) NOT NULL, locale VARCHAR(5), google_sync BOOLEAN, sync_code VARCHAR(255), google_token VARCHAR(255), FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) ); CREATE TABLE MINDMAP ( id INTEGER NOT NULL IDENTITY, title VARCHAR(255) NOT NULL, description VARCHAR(255), xml LONGVARBINARY NOT NULL, public BOOLEAN NOT NULL, creation_date DATETIME, edition_date DATETIME, creator_id INTEGER NOT NULL, last_editor_id INTEGER NOT NULL --FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id) ); CREATE TABLE LABEL ( id INTEGER NOT NULL PRIMARY KEY IDENTITY, title VARCHAR(30), creator_id INTEGER NOT NULL, parent_label_id INTEGER, color VARCHAR(7) NOT NULL, iconName VARCHAR(50) NOT NULL --FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id) ); CREATE TABLE R_LABEL_MINDMAP ( mindmap_id INTEGER NOT NULL, label_id INTEGER NOT NULL, PRIMARY KEY (mindmap_id, label_id), FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id), FOREIGN KEY (label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION ); CREATE TABLE MINDMAP_HISTORY ( id INTEGER NOT NULL IDENTITY, xml LONGVARBINARY NOT NULL, mindmap_id INTEGER NOT NULL, creation_date DATETIME, editor_id INTEGER NOT NULL, FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ); CREATE TABLE COLLABORATION_PROPERTIES ( id INTEGER NOT NULL IDENTITY, starred BOOLEAN NOT NULL, mindmap_properties VARCHAR(512) ); CREATE TABLE COLLABORATION ( id INTEGER NOT NULL IDENTITY, colaborator_id INTEGER NOT NULL, properties_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL, role_id INTEGER NOT NULL, FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id), FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id), FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) ); CREATE TABLE ACCESS_AUDITORY ( id INTEGER NOT NULL IDENTITY, user_id INTEGER NOT NULL, login_date DATE, FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION ); COMMIT; \ No newline at end of file diff --git a/config/database/hsql/drop-schemas.sql b/config/database/hsql/drop-schemas.sql index 22dc8016..77bf9e7b 100644 --- a/config/database/hsql/drop-schemas.sql +++ b/config/database/hsql/drop-schemas.sql @@ -1,10 +1 @@ -DROP TABLE IF EXISTS ACCESS_AUDITORY; -DROP TABLE IF EXISTS COLLABORATION; -DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; -DROP TABLE IF EXISTS MINDMAP_HISTORY; -DROP TABLE IF EXISTS R_LABEL_MINDMAP; -DROP TABLE IF EXISTS LABEL; -DROP TABLE IF EXISTS MINDMAP; -DROP TABLE IF EXISTS USER; -DROP TABLE IF EXISTS COLLABORATOR; -COMMIT; +DROP TABLE IF EXISTS ACCESS_AUDITORY; DROP TABLE IF EXISTS COLLABORATION; DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; DROP TABLE IF EXISTS MINDMAP_HISTORY; DROP TABLE IF EXISTS R_LABEL_MINDMAP; DROP TABLE IF EXISTS LABEL; DROP TABLE IF EXISTS MINDMAP; DROP TABLE IF EXISTS USER; DROP TABLE IF EXISTS COLLABORATOR; COMMIT; \ No newline at end of file diff --git a/config/database/mysql/apopulate-schemas.sql b/config/database/mysql/apopulate-schemas.sql index a4daf933..f5e38020 100644 --- a/config/database/mysql/apopulate-schemas.sql +++ b/config/database/mysql/apopulate-schemas.sql @@ -1,13 +1 @@ -# -# Command: mysql -u root -p < apopulate_schemas.sql -# - -INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE()); -INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) - VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); - -INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE()); -INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) - VALUES (2, 'Admin', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); - -COMMIT; +# # Command: mysql -u root -p < apopulate_schemas.sql # INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (1, 'test@wisemapping.org', CURRENT_DATE()); INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (1, 'Test', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); INSERT INTO COLLABORATOR (id, email, creation_date) VALUES (2, 'admin@wisemapping.org', CURRENT_DATE()); INSERT INTO USER (colaborator_id, firstname, lastname, password, activation_code, activation_date, allow_send_email,authentication_type) VALUES (2, 'Admin', 'User', 'ENC:a94a8fe5ccb19ba61c4c0873d391e987982fbbd3', 1237, CURRENT_DATE(), 1,'D'); COMMIT; \ No newline at end of file diff --git a/config/database/mysql/create-database.sql b/config/database/mysql/create-database.sql index 6d2cd226..edadeef9 100644 --- a/config/database/mysql/create-database.sql +++ b/config/database/mysql/create-database.sql @@ -1,10 +1 @@ -# -# Command: mysql -u root -p < create_database.sql -# -DROP DATABASE IF EXISTS wisemapping; - -CREATE DATABASE IF NOT EXISTS wisemapping - CHARACTER SET = 'utf8' - COLLATE = 'utf8_unicode_ci'; -GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost'; -SET PASSWORD FOR 'wisemapping'@'localhost' = PASSWORD('password'); \ No newline at end of file +# # Command: mysql -u root -p < create_database.sql # DROP DATABASE IF EXISTS wisemapping; CREATE DATABASE IF NOT EXISTS wisemapping CHARACTER SET = 'utf8' COLLATE = 'utf8_unicode_ci'; GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost'; SET PASSWORD FOR 'wisemapping'@'localhost' = PASSWORD('password'); \ No newline at end of file diff --git a/config/database/mysql/create-schemas.sql b/config/database/mysql/create-schemas.sql index e8d67e90..f9e609bf 100644 --- a/config/database/mysql/create-schemas.sql +++ b/config/database/mysql/create-schemas.sql @@ -1,128 +1 @@ -# -# Command: mysql -u root -p < create_schemas.sql -# - -USE wisemapping; - -CREATE TABLE COLLABORATOR ( - id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, - email VARCHAR(255) - CHARACTER SET utf8 NOT NULL UNIQUE, - creation_date DATE -) - CHARACTER SET utf8; - -CREATE TABLE USER ( - colaborator_id INTEGER NOT NULL PRIMARY KEY, - authentication_type CHAR(1) - CHARACTER SET utf8 NOT NULL, - authenticator_uri VARCHAR(255) - CHARACTER SET utf8, - firstname VARCHAR(255) CHARACTER SET utf8 NOT NULL, - lastname VARCHAR(255) CHARACTER SET utf8 NOT NULL, - password VARCHAR(255) CHARACTER SET utf8 NOT NULL, - activation_code BIGINT(20) NOT NULL, - activation_date DATE, - allow_send_email CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 0, - locale VARCHAR(5), - google_sync BOOL, - sync_code VARCHAR(255), - google_token VARCHAR(255), - FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) - ON DELETE CASCADE - ON UPDATE NO ACTION -) - CHARACTER SET utf8; - -CREATE TABLE MINDMAP ( - id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, - title VARCHAR(255) - CHARACTER SET utf8 NOT NULL, - description VARCHAR(255) - CHARACTER SET utf8 NOT NULL, - xml MEDIUMBLOB NOT NULL, - public BOOL NOT NULL DEFAULT 0, - creation_date DATETIME, - edition_date DATETIME, - creator_id INTEGER NOT NULL, - last_editor_id INTEGER NOT NULL, - FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id) - ON DELETE CASCADE - ON UPDATE NO ACTION -) - CHARACTER SET utf8; - -CREATE TABLE LABEL ( - id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, - title VARCHAR(30) - CHARACTER SET utf8 NOT NULL, - creator_id INTEGER NOT NULL, - parent_label_id INTEGER, - color VARCHAR(7) NOT NULL, - iconName VARCHAR(50) NOT NULL, - FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id), - FOREIGN KEY (parent_label_id) REFERENCES LABEL (id) - ON DELETE CASCADE - ON UPDATE NO ACTION -) - CHARACTER SET utf8; - -CREATE TABLE R_LABEL_MINDMAP ( - mindmap_id INTEGER NOT NULL, - label_id INTEGER NOT NULL, - PRIMARY KEY (mindmap_id, label_id), - FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id), - FOREIGN KEY (label_id) REFERENCES LABEL (id) - ON DELETE CASCADE - ON UPDATE NO ACTION -) - CHARACTER SET utf8; - -CREATE TABLE MINDMAP_HISTORY -(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, - xml MEDIUMBLOB NOT NULL, - mindmap_id INTEGER NOT NULL, - creation_date DATETIME, - editor_id INTEGER NOT NULL, - FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) - ON DELETE CASCADE - ON UPDATE NO ACTION -) - CHARACTER SET utf8; - -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; - -CREATE TABLE COLLABORATION ( - id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, - colaborator_id INTEGER NOT NULL, - properties_id INTEGER NOT NULL, - mindmap_id INTEGER NOT NULL, - role_id INTEGER NOT NULL, - FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id), - FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) - ON DELETE CASCADE - ON UPDATE NO ACTION, - FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) - ON DELETE CASCADE - ON UPDATE NO ACTION - UNIQUE KEY UC_ROLE (mindmap_id,colaborator_id) -) - CHARACTER SET utf8; - -CREATE TABLE ACCESS_AUDITORY ( - id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, - login_date DATE, - user_id INTEGER NOT NULL, - FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) - ON DELETE CASCADE - ON UPDATE NO ACTION -) - CHARACTER SET utf8; - -COMMIT; \ No newline at end of file +# # Command: mysql -u root -p < create_schemas.sql # USE wisemapping; CREATE TABLE COLLABORATOR ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, email VARCHAR(255) CHARACTER SET utf8 NOT NULL UNIQUE, creation_date DATE ) CHARACTER SET utf8; CREATE TABLE USER ( colaborator_id INTEGER NOT NULL PRIMARY KEY, authentication_type CHAR(1) CHARACTER SET utf8 NOT NULL, authenticator_uri VARCHAR(255) CHARACTER SET utf8, firstname VARCHAR(255) CHARACTER SET utf8 NOT NULL, lastname VARCHAR(255) CHARACTER SET utf8 NOT NULL, password VARCHAR(255) CHARACTER SET utf8 NOT NULL, activation_code BIGINT(20) NOT NULL, activation_date DATE, allow_send_email CHAR(1) CHARACTER SET utf8 NOT NULL DEFAULT 0, locale VARCHAR(5), google_sync BOOL, sync_code VARCHAR(255), google_token VARCHAR(255), FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id) ON DELETE CASCADE ON UPDATE NO ACTION ) CHARACTER SET utf8; CREATE TABLE MINDMAP ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, title VARCHAR(255) CHARACTER SET utf8 NOT NULL, description VARCHAR(255) CHARACTER SET utf8 NOT NULL, xml MEDIUMBLOB NOT NULL, public BOOL NOT NULL DEFAULT 0, creation_date DATETIME, edition_date DATETIME, creator_id INTEGER NOT NULL, last_editor_id INTEGER NOT NULL, FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION ) CHARACTER SET utf8; CREATE TABLE LABEL ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, title VARCHAR(30) CHARACTER SET utf8 NOT NULL, creator_id INTEGER NOT NULL, parent_label_id INTEGER, color VARCHAR(7) NOT NULL, iconName VARCHAR(50) NOT NULL, FOREIGN KEY (creator_id) REFERENCES USER (colaborator_id), FOREIGN KEY (parent_label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION ) CHARACTER SET utf8; CREATE TABLE R_LABEL_MINDMAP ( mindmap_id INTEGER NOT NULL, label_id INTEGER NOT NULL, PRIMARY KEY (mindmap_id, label_id), FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id), FOREIGN KEY (label_id) REFERENCES LABEL (id) ON DELETE CASCADE ON UPDATE NO ACTION ) CHARACTER SET utf8; CREATE TABLE MINDMAP_HISTORY (id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, xml MEDIUMBLOB NOT NULL, mindmap_id INTEGER NOT NULL, creation_date DATETIME, editor_id INTEGER NOT NULL, FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION ) CHARACTER SET utf8; 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; CREATE TABLE COLLABORATION ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, colaborator_id INTEGER NOT NULL, properties_id INTEGER NOT NULL, mindmap_id INTEGER NOT NULL, role_id INTEGER NOT NULL, UNIQUE KEY UC_ROLE (mindmap_id,colaborator_id), FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id), FOREIGN KEY (mindmap_id) REFERENCES MINDMAP (id) ON DELETE CASCADE ON UPDATE NO ACTION, FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) ON DELETE CASCADE ON UPDATE NO ACTION ) CHARACTER SET utf8; CREATE TABLE ACCESS_AUDITORY ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, login_date DATE, user_id INTEGER NOT NULL, FOREIGN KEY (user_id) REFERENCES USER (colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION ) CHARACTER SET utf8; COMMIT; \ No newline at end of file diff --git a/config/database/mysql/drop-schemas.sql b/config/database/mysql/drop-schemas.sql index d1a1e95d..6be70e14 100644 --- a/config/database/mysql/drop-schemas.sql +++ b/config/database/mysql/drop-schemas.sql @@ -1,10 +1 @@ -DROP TABLE IF EXISTS ACCESS_AUDITORY; -DROP TABLE IF EXISTS COLLABORATION; -DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; -DROP TABLE IF EXISTS MINDMAP_HISTORY; -DROP TABLE IF EXISTS LABEL; -DROP TABLE IF EXISTS MINDMAP; -DROP TABLE IF EXISTS R_LABEL_MINDMAP -DROP TABLE IF EXISTS USER; -DROP TABLE IF EXISTS COLLABORATOR; -COMMIT; \ No newline at end of file +DROP TABLE IF EXISTS ACCESS_AUDITORY; DROP TABLE IF EXISTS COLLABORATION; DROP TABLE IF EXISTS COLLABORATION_PROPERTIES; DROP TABLE IF EXISTS MINDMAP_HISTORY; DROP TABLE IF EXISTS LABEL; DROP TABLE IF EXISTS MINDMAP; DROP TABLE IF EXISTS R_LABEL_MINDMAP DROP TABLE IF EXISTS USER; DROP TABLE IF EXISTS COLLABORATOR; COMMIT; \ No newline at end of file