2009-06-07 20:59:43 +02:00
|
|
|
CREATE TABLE COLABORATOR (
|
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,
|
|
|
|
username varchar(255) NOT NULL,
|
|
|
|
firstname varchar(255) NOT NULL,
|
|
|
|
lastname varchar(255) NOT NULL,
|
|
|
|
password varchar(255) NOT NULL,
|
|
|
|
activationCode BIGINT NOT NULL,
|
|
|
|
activation_date DATE,
|
|
|
|
allowSendEmail CHAR(1) NOT NULL,
|
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES colaborator(id)
|
|
|
|
) ;
|
|
|
|
|
|
|
|
CREATE TABLE MINDMAP (
|
2012-02-21 18:22:43 +01:00
|
|
|
id INTEGER NOT NULL IDENTITY,
|
2009-06-07 20:59:43 +02:00
|
|
|
title VARCHAR(255) NOT NULL,
|
|
|
|
description VARCHAR(255) NOT NULL,
|
|
|
|
xml LONGVARBINARY NOT NULL,
|
|
|
|
public BOOLEAN not null,
|
|
|
|
creation_date date,
|
|
|
|
edition_date date,
|
|
|
|
owner_id INTEGER not null,
|
|
|
|
tags varchar(1014) ,
|
|
|
|
last_editor varchar(255) ,
|
|
|
|
creator_user varchar(255) ,
|
|
|
|
editor_properties varchar(512)
|
|
|
|
--FOREIGN KEY(owner_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,
|
|
|
|
creation_date datetime,
|
2012-02-21 18:22:43 +01:00
|
|
|
creator_user varchar(255));
|
2009-06-07 20:59:43 +02:00
|
|
|
|
2012-02-21 18:22:43 +01:00
|
|
|
CREATE TABLE MINDMAP_COLABORATOR
|
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
2009-06-07 20:59:43 +02:00
|
|
|
colaborator_id INTEGER NOT NULL,
|
|
|
|
mindmap_id INTEGER NOT NULL,
|
|
|
|
role_id INTEGER NOT NULL,
|
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES colaborator(id),
|
|
|
|
FOREIGN KEY(mindmap_id) REFERENCES mindmap(id)
|
2012-02-21 18:22:43 +01:00
|
|
|
);
|
2009-06-07 20:59:43 +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,
|
2009-06-07 20:59:43 +02:00
|
|
|
--FOREIGN KEY(user_id) REFERENCES user(colaborator_id)
|
|
|
|
);
|
|
|
|
|
2012-02-21 18:22:43 +01:00
|
|
|
CREATE TABLE USER_LOGIN
|
|
|
|
(id INTEGER NOT NULL IDENTITY,
|
|
|
|
email varchar(255),
|
|
|
|
login_date date);
|
2009-06-07 20:59:43 +02:00
|
|
|
COMMIT;
|
|
|
|
SHUTDOWN;
|