From 59d7ffd9c5d22e622fa0f87cd5fe4404aeed0aaa Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Fri, 28 Oct 2022 01:45:18 +0000 Subject: [PATCH] Fix creation table issue. --- config/database/postgres/create-schemas.sql | 24 ++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/config/database/postgres/create-schemas.sql b/config/database/postgres/create-schemas.sql index acc839bd..d9190c7c 100644 --- a/config/database/postgres/create-schemas.sql +++ b/config/database/postgres/create-schemas.sql @@ -27,14 +27,6 @@ CREATE TABLE LABEL ( --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 ( id SERIAL NOT NULL PRIMARY KEY, title VARCHAR(255) NOT NULL, @@ -44,11 +36,17 @@ CREATE TABLE MINDMAP ( creation_date TIMESTAMP, edition_date TIMESTAMP, creator_id INTEGER NOT NULL, - tags VARCHAR(1014), last_editor_id INTEGER NOT NULL --, --FOREIGN KEY(creator_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION ); +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 SERIAL NOT NULL PRIMARY KEY, @@ -77,14 +75,6 @@ CREATE TABLE COLLABORATION ( FOREIGN KEY (properties_id) REFERENCES COLLABORATION_PROPERTIES (id) ON DELETE CASCADE ON UPDATE NO ACTION ); -CREATE TABLE TAG ( - id SERIAL NOT NULL PRIMARY KEY, - name VARCHAR(255) NOT NULL, - user_id INTEGER NOT NULL --, ---FOREIGN KEY(user_id) REFERENCES "USER"(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION -); - - CREATE TABLE ACCESS_AUDITORY ( id SERIAL NOT NULL PRIMARY KEY, login_date DATE,