2012-06-22 06:34:33 +02:00
|
|
|
CREATE TABLE COLLABORATOR (
|
2012-02-21 18:22:43 +01:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
2009-06-07 20:59:43 +02:00
|
|
|
email varchar(255) NOT NULL,
|
2012-02-21 18:22:43 +01:00
|
|
|
creation_date date);
|
2009-06-07 20:59:43 +02:00
|
|
|
|
|
|
|
CREATE TABLE USER (
|
2012-02-21 18:22:43 +01:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
2009-06-07 20:59:43 +02:00
|
|
|
colaborator_id INTEGER NOT NULL,
|
2013-03-17 22:51:33 +01:00
|
|
|
auth_schema CHAR(1) NOT NULL,
|
2009-06-07 20:59:43 +02:00
|
|
|
firstname varchar(255) NOT NULL,
|
|
|
|
lastname varchar(255) NOT NULL,
|
|
|
|
password varchar(255) NOT NULL,
|
2012-07-15 05:57:44 +02:00
|
|
|
activation_code BIGINT NOT NULL,
|
2009-06-07 20:59:43 +02:00
|
|
|
activation_date DATE,
|
2012-07-15 05:57:44 +02:00
|
|
|
allow_send_email CHAR(1) NOT NULL,
|
2012-06-30 07:26:21 +02:00
|
|
|
locale varchar(5),
|
2012-06-22 06:34:33 +02:00
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES COLLABORATOR(id)
|
2012-02-21 19:37:15 +01:00
|
|
|
);
|
2009-06-07 20:59:43 +02:00
|
|
|
|
|
|
|
CREATE TABLE MINDMAP (
|
2012-02-21 18:22:43 +01:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
2012-05-30 03:36:32 +02:00
|
|
|
title VARCHAR(255) NOT NULL,
|
2009-06-07 20:59:43 +02:00
|
|
|
description VARCHAR(255) NOT NULL,
|
|
|
|
xml LONGVARBINARY NOT NULL,
|
2012-05-30 03:36:32 +02:00
|
|
|
public BOOLEAN NOT NULL,
|
2012-04-08 23:36:22 +02:00
|
|
|
creation_date DATETIME,
|
|
|
|
edition_date DATETIME,
|
2012-06-12 16:23:47 +02:00
|
|
|
creator_id INTEGER NOT NULL,
|
2009-06-07 20:59:43 +02:00
|
|
|
tags varchar(1014) ,
|
2012-07-15 05:57:44 +02:00
|
|
|
last_editor_id INTEGER NOT NULL
|
2012-06-12 16:23:47 +02:00
|
|
|
--FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id)
|
2012-02-21 18:22:43 +01:00
|
|
|
);
|
2009-06-07 20:59:43 +02:00
|
|
|
|
|
|
|
CREATE TABLE MINDMAP_HISTORY
|
2012-02-21 18:22:43 +01:00
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
2009-06-07 20:59:43 +02:00
|
|
|
xml LONGVARBINARY NOT NULL,
|
|
|
|
mindmap_id INTEGER NOT NULL,
|
2012-04-08 23:36:22 +02:00
|
|
|
creation_date DATETIME,
|
2012-07-15 06:25:21 +02:00
|
|
|
editor_id INTEGER NOT NULL,
|
|
|
|
FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id));
|
2009-06-07 20:59:43 +02:00
|
|
|
|
2012-06-10 03:55:55 +02:00
|
|
|
CREATE TABLE COLLABORATION_PROPERTIES
|
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
2012-06-18 02:43:34 +02:00
|
|
|
starred BOOLEAN NOT NULL,
|
|
|
|
mindmap_properties varchar(512)
|
2012-06-10 03:55:55 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE COLLABORATION
|
2012-02-21 18:22:43 +01:00
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
2009-06-07 20:59:43 +02:00
|
|
|
colaborator_id INTEGER NOT NULL,
|
2012-06-18 02:43:34 +02:00
|
|
|
properties_id INTEGER NOT NULL,
|
2009-06-07 20:59:43 +02:00
|
|
|
mindmap_id INTEGER NOT NULL,
|
|
|
|
role_id INTEGER NOT NULL,
|
2012-06-22 06:34:33 +02:00
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES COLLABORATOR(id),
|
2012-06-10 03:55:55 +02:00
|
|
|
FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id),
|
|
|
|
FOREIGN KEY(properties_id) REFERENCES COLLABORATION_PROPERTIES(id)
|
2012-02-21 18:22:43 +01:00
|
|
|
);
|
2009-06-07 20:59:43 +02:00
|
|
|
|
2012-06-10 03:55:55 +02:00
|
|
|
|
2012-02-21 18:22:43 +01:00
|
|
|
CREATE TABLE TAG
|
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
2009-06-07 20:59:43 +02:00
|
|
|
name varchar(255) NOT NULL,
|
2012-02-21 18:22:43 +01:00
|
|
|
user_id INTEGER NOT NULL,
|
2012-05-30 03:36:32 +02:00
|
|
|
--FOREIGN KEY(user_id) REFERENCES USER(colaborator_id)
|
2009-06-07 20:59:43 +02:00
|
|
|
);
|
|
|
|
|
2012-06-23 21:15:59 +02:00
|
|
|
CREATE TABLE ACCESS_AUDITORY (
|
|
|
|
id INTEGER NOT NULL IDENTITY,
|
|
|
|
user_id INTEGER NOT NULL,
|
2012-07-15 06:38:52 +02:00
|
|
|
login_date date
|
2012-06-23 21:15:59 +02:00
|
|
|
);
|
|
|
|
|
2013-03-14 22:51:17 +01:00
|
|
|
COMMIT;
|