2012-06-22 01:34:33 -03:00
|
|
|
CREATE TABLE COLLABORATOR (
|
2013-03-17 23:19:29 -03:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
|
|
|
email VARCHAR(255) NOT NULL,
|
|
|
|
creation_date DATE);
|
2009-06-07 18:59:43 +00:00
|
|
|
|
|
|
|
CREATE TABLE USER (
|
2013-03-17 23:19:29 -03:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
|
|
|
colaborator_id INTEGER NOT NULL,
|
|
|
|
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),
|
|
|
|
FOREIGN KEY (colaborator_id) REFERENCES COLLABORATOR (id)
|
2012-02-21 15:37:15 -03:00
|
|
|
);
|
2009-06-07 18:59:43 +00:00
|
|
|
|
|
|
|
CREATE TABLE MINDMAP (
|
2013-03-17 23:19:29 -03:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
|
|
|
title VARCHAR(255) NOT NULL,
|
|
|
|
description VARCHAR(255) NOT NULL,
|
|
|
|
xml LONGVARBINARY NOT NULL,
|
|
|
|
public BOOLEAN NOT NULL,
|
|
|
|
creation_date DATETIME,
|
|
|
|
edition_date DATETIME,
|
|
|
|
creator_id INTEGER NOT NULL,
|
|
|
|
tags VARCHAR(1014),
|
|
|
|
last_editor_id INTEGER NOT NULL
|
2012-06-12 11:23:47 -03:00
|
|
|
--FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id)
|
2012-02-21 14:22:43 -03:00
|
|
|
);
|
2009-06-07 18:59:43 +00:00
|
|
|
|
|
|
|
CREATE TABLE MINDMAP_HISTORY
|
2013-03-17 23:19:29 -03:00
|
|
|
(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));
|
2009-06-07 18:59:43 +00:00
|
|
|
|
2012-06-09 22:55:55 -03:00
|
|
|
CREATE TABLE COLLABORATION_PROPERTIES
|
2013-03-17 23:19:29 -03:00
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
|
|
|
starred BOOLEAN NOT NULL,
|
|
|
|
mindmap_properties VARCHAR(512)
|
2012-06-09 22:55:55 -03:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE COLLABORATION
|
2013-03-17 23:19:29 -03:00
|
|
|
(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)
|
2012-02-21 14:22:43 -03:00
|
|
|
);
|
2009-06-07 18:59:43 +00:00
|
|
|
|
2012-06-09 22:55:55 -03:00
|
|
|
|
2012-02-21 14:22:43 -03:00
|
|
|
CREATE TABLE TAG
|
2013-03-17 23:19:29 -03:00
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
|
|
|
name VARCHAR(255) NOT NULL,
|
|
|
|
user_id INTEGER NOT NULL,
|
2012-05-29 22:36:32 -03:00
|
|
|
--FOREIGN KEY(user_id) REFERENCES USER(colaborator_id)
|
2009-06-07 18:59:43 +00:00
|
|
|
);
|
|
|
|
|
2012-06-23 16:15:59 -03:00
|
|
|
CREATE TABLE ACCESS_AUDITORY (
|
2013-03-17 23:19:29 -03:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
|
|
|
user_id INTEGER NOT NULL,
|
|
|
|
login_date DATE
|
2012-06-23 16:15:59 -03:00
|
|
|
);
|
|
|
|
|
2013-03-14 21:51:17 +00:00
|
|
|
COMMIT;
|