diff --git a/sql/tables.sql b/sql/tables.sql index f788df7..0b767ca 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -7,17 +7,18 @@ lastused DATETIME, ip CHAR(30) ) TYPE = InnoDB; +CREATE TABLE archive_settings ( +id INTEGER NOT NULL, +document_id INTEGER NOT NULL, +expiration_date DATETIME, +utilisation_threshold INTEGER +) TYPE = InnoDB; + CREATE TABLE data_types ( id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, name CHAR(255) NOT NULL )TYPE = InnoDB; -CREATE TABLE document_link ( -id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, -parent_document_id INTEGER NOT NULL, -child_document_id INTEGER NOT NULL -) TYPE = InnoDB; - CREATE TABLE dependant_documents ( id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, document_title TEXT, @@ -25,8 +26,6 @@ user_id INTEGER, template_document_id INTEGER ) TYPE = InnoDB; - - CREATE TABLE discussion_threads ( id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, document_id INTEGER NOT NULL, @@ -61,6 +60,12 @@ document_field_id INTEGER NOT NULL, value CHAR(255) NOT NULL )TYPE = InnoDB; +CREATE TABLE document_link ( +id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, +parent_document_id INTEGER NOT NULL, +child_document_id INTEGER NOT NULL +) TYPE = InnoDB; + CREATE TABLE document_text ( id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, document_id integer, @@ -114,7 +119,8 @@ minor_version INTEGER NOT NULL, is_checked_out BIT NOT NULL, parent_folder_ids TEXT, full_path TEXT, -checked_out_user_id INTEGER +checked_out_user_id INTEGER, +status_id INTEGER )TYPE = InnoDB; CREATE TABLE document_subscriptions ( @@ -223,6 +229,13 @@ mimetypes CHAR(100) NOT NULL, icon_path CHAR(255) )TYPE = InnoDB; +CREATE TABLE new_documents ( +id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, +document_title TEXT, +user_id INTEGER, +template_document_id INTEGER +) TYPE = InnoDB; + CREATE TABLE news ( id INTEGER NOT NULL UNIQUE AUTO_INCREMENT, synopsis VARCHAR(255) NOT NULL, @@ -358,6 +371,11 @@ ADD CONSTRAINT PK_active_sessions PRIMARY KEY (id) ; +ALTER TABLE archive_settings +ADD CONSTRAINT PK_archive_settings +PRIMARY KEY (id) +; + ALTER TABLE folder_doctypes_link ADD CONSTRAINT PK_folder_doctypes_link PRIMARY KEY (id)