Fix creation table issue.

This commit is contained in:
Paulo Veiga 2022-10-28 01:45:18 +00:00
parent 24e2ba93f3
commit 59d7ffd9c5

View File

@ -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,