2009-06-07 20:59:43 +02:00
|
|
|
CREATE TABLE COLABORATOR (
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
email varchar(255) CHARACTER SET utf8 NOT NULL UNIQUE,
|
|
|
|
creation_date date
|
|
|
|
) CHARACTER SET utf8;
|
|
|
|
|
|
|
|
CREATE TABLE USER (
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
colaborator_id INTEGER NOT NULL,
|
|
|
|
username varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
firstname varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
lastname varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
password varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
activationCode BIGINT(20) NOT NULL,
|
|
|
|
activation_date date,
|
|
|
|
allowSendEmail char(1) CHARACTER SET utf8 NOT NULL default 0,
|
2011-06-29 15:33:41 +02:00
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES COLABORATOR(id)
|
2009-06-07 20:59:43 +02:00
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
|
|
|
CREATE TABLE MINDMAP (
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
title varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
description varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
xml blob NOT NULL,
|
|
|
|
public BOOL not null default 0,
|
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) CHARACTER SET utf8 ,
|
|
|
|
last_editor varchar(255) CHARACTER SET utf8 ,
|
2012-06-12 16:23:47 +02:00
|
|
|
FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id)
|
2009-06-07 20:59:43 +02:00
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
2012-05-30 03:36:32 +02:00
|
|
|
|
|
|
|
CREATE TABLE MINDMAP_HISTORY
|
|
|
|
(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
2009-06-07 20:59:43 +02:00
|
|
|
xml blob NOT NULL,
|
|
|
|
mindmap_id INTEGER NOT NULL,
|
|
|
|
creation_date datetime,
|
|
|
|
creator_user varchar(255) CHARACTER SET utf8
|
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
2012-06-10 03:55:55 +02:00
|
|
|
CREATE TABLE COLLABORATION_PROPERTIES(
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
2012-06-18 02:43:34 +02:00
|
|
|
starred BOOL NOT NULL default 0,
|
|
|
|
mindmap_properties varchar(512) CHARACTER SET utf8
|
2012-06-10 03:55:55 +02:00
|
|
|
) CHARACTER SET utf8;
|
|
|
|
|
|
|
|
CREATE TABLE COLLABORATION (
|
2009-06-07 20:59:43 +02:00
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
colaborator_id INTEGER NOT NULL,
|
2012-06-10 03:55:55 +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,
|
2011-06-29 15:33:41 +02:00
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES COLABORATOR(id),
|
|
|
|
FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id)
|
2012-06-10 03:55:55 +02:00
|
|
|
FOREIGN KEY(properties_id) REFERENCES COLLABORATION_PROPERTIES(id),
|
2009-06-07 20:59:43 +02:00
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
|
|
|
CREATE TABLE TAG(
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
name varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
user_id INTEGER NOT NULL,
|
2011-06-29 15:33:41 +02:00
|
|
|
FOREIGN KEY(user_id) REFERENCES USER(colaborator_id)
|
2009-06-07 20:59:43 +02:00
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
|
|
|
CREATE TABLE USER_LOGIN (
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
email varchar(255) CHARACTER SET utf8 ,
|
|
|
|
login_date date
|
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
COMMIT;
|