wisemapping-open-source/config/database/hsql/create-schemas.sql

74 lines
1.8 KiB
MySQL
Raw Normal View History

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