2012-06-22 01:34:33 -03:00
|
|
|
CREATE TABLE COLLABORATOR (
|
2009-06-07 18:59:43 +00:00
|
|
|
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,
|
|
|
|
firstname varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
lastname varchar(255) CHARACTER SET utf8 NOT NULL,
|
|
|
|
password varchar(255) CHARACTER SET utf8 NOT NULL,
|
2012-07-15 01:25:21 -03:00
|
|
|
activation_code BIGINT(20) NOT NULL,
|
2009-06-07 18:59:43 +00:00
|
|
|
activation_date date,
|
2012-07-15 01:25:21 -03:00
|
|
|
allow_send_email char(1) CHARACTER SET utf8 NOT NULL default 0,
|
2012-06-30 02:26:21 -03:00
|
|
|
locale varchar(5),
|
2012-06-23 16:15:59 -03:00
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES COLLABORATOR(id) ON DELETE CASCADE ON UPDATE NO ACTION
|
2009-06-07 18:59:43 +00: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,
|
2012-10-01 00:57:49 -03:00
|
|
|
xml mediumblob NOT NULL,
|
2009-06-07 18:59:43 +00:00
|
|
|
public BOOL not null default 0,
|
2012-04-08 18:36:22 -03:00
|
|
|
creation_date datetime,
|
|
|
|
edition_date datetime,
|
2012-06-12 11:23:47 -03:00
|
|
|
creator_id INTEGER not null,
|
2009-06-07 18:59:43 +00:00
|
|
|
tags varchar(1014) CHARACTER SET utf8 ,
|
2012-07-15 00:57:44 -03:00
|
|
|
last_editor_id INTEGER NOT NULL,
|
2012-06-23 16:15:59 -03:00
|
|
|
FOREIGN KEY(creator_id) REFERENCES USER(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
2009-06-07 18:59:43 +00:00
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
2012-05-29 22:36:32 -03:00
|
|
|
|
|
|
|
CREATE TABLE MINDMAP_HISTORY
|
|
|
|
(id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
2012-10-01 00:57:49 -03:00
|
|
|
xml mediumblob NOT NULL,
|
2009-06-07 18:59:43 +00:00
|
|
|
mindmap_id INTEGER NOT NULL,
|
|
|
|
creation_date datetime,
|
2012-07-15 01:25:21 -03:00
|
|
|
editor_id INTEGER NOT NULL,
|
|
|
|
FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) ON DELETE CASCADE ON UPDATE NO ACTION
|
2009-06-07 18:59:43 +00:00
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
2012-06-09 22:55:55 -03:00
|
|
|
CREATE TABLE COLLABORATION_PROPERTIES(
|
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
2012-06-17 21:43:34 -03:00
|
|
|
starred BOOL NOT NULL default 0,
|
|
|
|
mindmap_properties varchar(512) CHARACTER SET utf8
|
2012-06-09 22:55:55 -03:00
|
|
|
) CHARACTER SET utf8;
|
|
|
|
|
|
|
|
CREATE TABLE COLLABORATION (
|
2009-06-07 18:59:43 +00:00
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
|
|
|
colaborator_id INTEGER NOT NULL,
|
2012-06-09 22:55:55 -03:00
|
|
|
properties_id INTEGER NOT NULL,
|
2009-06-07 18:59:43 +00:00
|
|
|
mindmap_id INTEGER NOT NULL,
|
|
|
|
role_id INTEGER NOT NULL,
|
2012-06-22 01:34:33 -03:00
|
|
|
FOREIGN KEY(colaborator_id) REFERENCES COLLABORATOR(id),
|
2012-06-23 16:15:59 -03:00
|
|
|
FOREIGN KEY(mindmap_id) REFERENCES MINDMAP(id) ON DELETE CASCADE ON UPDATE NO ACTION,
|
|
|
|
FOREIGN KEY(properties_id) REFERENCES COLLABORATION_PROPERTIES(id) ON DELETE CASCADE ON UPDATE NO ACTION
|
2009-06-07 18:59:43 +00: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,
|
2012-06-23 16:15:59 -03:00
|
|
|
FOREIGN KEY(user_id) REFERENCES USER(colaborator_id) ON DELETE CASCADE ON UPDATE NO ACTION
|
2009-06-07 18:59:43 +00:00
|
|
|
) CHARACTER SET utf8 ;
|
|
|
|
|
2012-06-23 16:15:59 -03:00
|
|
|
CREATE TABLE ACCESS_AUDITORY (
|
2009-06-07 18:59:43 +00:00
|
|
|
id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
2012-06-23 16:15:59 -03:00
|
|
|
login_date date,
|
2012-07-15 01:38:52 -03:00
|
|
|
user_id INTEGER NOT NULL
|
2009-06-07 18:59:43 +00:00
|
|
|
) CHARACTER SET utf8 ;
|
2012-06-23 16:15:59 -03:00
|
|
|
|
2009-06-07 18:59:43 +00:00
|
|
|
COMMIT;
|