seeddms-code/install/create_tables-sqlite3.sql

625 lines
19 KiB
MySQL
Raw Normal View History

2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblACLs`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblACLs` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`target` INTEGER NOT NULL default '0',
`targetType` INTEGER NOT NULL default '0',
`userID` INTEGER NOT NULL default '-1',
`groupID` INTEGER NOT NULL default '-1',
`mode` INTEGER NOT NULL default '0'
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblCategory`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblCategory` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` text NOT NULL
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblAttributeDefinitions`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblAttributeDefinitions` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` varchar(100) default NULL,
`objtype` INTEGER NOT NULL default '0',
`type` INTEGER NOT NULL default '0',
`multiple` INTEGER NOT NULL default '0',
`minvalues` INTEGER NOT NULL default '0',
`maxvalues` INTEGER NOT NULL default '0',
`valueset` TEXT default NULL,
`regex` TEXT DEFAULT NULL,
2013-02-03 06:56:06 +00:00
UNIQUE(`name`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblUsers`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblUsers` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`login` varchar(50) default NULL,
`pwd` varchar(50) default NULL,
`fullName` varchar(100) default NULL,
`email` varchar(70) default NULL,
`language` varchar(32) NOT NULL,
`theme` varchar(32) NOT NULL,
`comment` text NOT NULL,
`role` INTEGER NOT NULL default '0',
`hidden` INTEGER NOT NULL default '0',
`pwdExpiration` TEXT default NULL,
2013-02-03 06:56:06 +00:00
`loginfailures` INTEGER NOT NULL default '0',
`disabled` INTEGER NOT NULL default '0',
`quota` INTEGER,
`homefolder` INTEGER default NULL REFERENCES `tblFolders` (`id`),
2013-02-03 06:56:06 +00:00
UNIQUE (`login`)
);
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblUserPasswordRequest`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblUserPasswordRequest` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`hash` varchar(50) default NULL,
`date` TEXT NOT NULL
2013-02-03 06:56:06 +00:00
);
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblUserPasswordHistory`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblUserPasswordHistory` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`pwd` varchar(50) default NULL,
`date` TEXT NOT NULL
2013-02-03 06:56:06 +00:00
);
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblUserImages`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblUserImages` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`image` blob NOT NULL,
`mimeType` varchar(100) NOT NULL default ''
2013-02-03 06:56:06 +00:00
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblFolders`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblFolders` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` varchar(70) default NULL,
`parent` INTEGER default NULL,
`folderList` text NOT NULL,
`comment` text,
`date` INTEGER default NULL,
`owner` INTEGER default NULL REFERENCES `tblUsers` (`id`),
`inheritAccess` INTEGER NOT NULL default '1',
`defaultAccess` INTEGER NOT NULL default '0',
`sequence` double NOT NULL default '0'
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblFolderAttributes`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblFolderAttributes` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`folder` INTEGER default NULL REFERENCES `tblFolders` (`id`) ON DELETE CASCADE,
`attrdef` INTEGER default NULL REFERENCES `tblAttributeDefinitions` (`id`),
`value` text default NULL,
UNIQUE (folder, attrdef)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocuments`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocuments` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` varchar(150) default NULL,
`comment` text,
`date` INTEGER default NULL,
`expires` INTEGER default NULL,
`owner` INTEGER default NULL REFERENCES `tblUsers` (`id`),
`folder` INTEGER default NULL REFERENCES `tblFolders` (`id`),
`folderList` text NOT NULL,
`inheritAccess` INTEGER NOT NULL default '1',
`defaultAccess` INTEGER NOT NULL default '0',
`locked` INTEGER NOT NULL default '-1',
`keywords` text NOT NULL,
`sequence` double NOT NULL default '0'
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentAttributes`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentAttributes` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`document` INTEGER default NULL REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`attrdef` INTEGER default NULL REFERENCES `tblAttributeDefinitions` (`id`),
`value` text default NULL,
UNIQUE (document, attrdef)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentApprovers`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentApprovers` (
`approveID` INTEGER PRIMARY KEY AUTOINCREMENT,
`documentID` INTEGER NOT NULL default '0' REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`version` INTEGER unsigned NOT NULL default '0',
`type` INTEGER NOT NULL default '0',
`required` INTEGER NOT NULL default '0',
UNIQUE (`documentID`,`version`,`type`,`required`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentApproveLog`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentApproveLog` (
`approveLogID` INTEGER PRIMARY KEY AUTOINCREMENT,
`approveID` INTEGER NOT NULL default '0' REFERENCES `tblDocumentApprovers` (`approveID`) ON DELETE CASCADE,
`status` INTEGER NOT NULL default '0',
`comment` TEXT NOT NULL,
`date` TEXT NOT NULL,
2013-02-03 06:56:06 +00:00
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentContent`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentContent` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`document` INTEGER NOT NULL default '0' REFERENCES `tblDocuments` (`id`),
`version` INTEGER unsigned NOT NULL,
`comment` text,
`date` INTEGER default NULL,
`createdBy` INTEGER default NULL,
`dir` varchar(255) NOT NULL default '',
`orgFileName` varchar(150) NOT NULL default '',
`fileType` varchar(10) NOT NULL default '',
`mimeType` varchar(100) NOT NULL default '',
2013-02-03 06:56:06 +00:00
`fileSize` INTEGER,
`checksum` char(32),
2013-02-03 06:56:06 +00:00
UNIQUE (`document`,`version`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentContentAttributes`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentContentAttributes` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`content` INTEGER default NULL REFERENCES `tblDocumentContent` (`id`) ON DELETE CASCADE,
`attrdef` INTEGER default NULL REFERENCES `tblAttributeDefinitions` (`id`),
`value` text default NULL,
UNIQUE (content, attrdef)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentLinks`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentLinks` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`document` INTEGER NOT NULL default 0 REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`target` INTEGER NOT NULL default 0 REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`userID` INTEGER NOT NULL default 0 REFERENCES `tblUsers` (`id`),
`public` INTEGER NOT NULL default 0
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentFiles`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentFiles` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`document` INTEGER NOT NULL default 0 REFERENCES `tblDocuments` (`id`),
2016-12-08 16:20:44 +00:00
`version` INTEGER unsigned NOT NULL default '0',
2013-02-03 06:56:06 +00:00
`userID` INTEGER NOT NULL default 0 REFERENCES `tblUsers` (`id`),
2016-12-08 16:20:44 +00:00
`public` INTEGER NOT NULL default '0',
2013-02-03 06:56:06 +00:00
`comment` text,
`name` varchar(150) default NULL,
`date` INTEGER default NULL,
`dir` varchar(255) NOT NULL default '',
`orgFileName` varchar(150) NOT NULL default '',
`fileType` varchar(10) NOT NULL default '',
`mimeType` varchar(100) NOT NULL default ''
2013-02-03 06:56:06 +00:00
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentLocks`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentLocks` (
`document` INTEGER REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentReviewers`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentReviewers` (
`reviewID` INTEGER PRIMARY KEY AUTOINCREMENT,
`documentID` INTEGER NOT NULL default '0' REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`version` INTEGER unsigned NOT NULL default '0',
`type` INTEGER NOT NULL default '0',
`required` INTEGER NOT NULL default '0',
UNIQUE (`documentID`,`version`,`type`,`required`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblDocumentReviewLog`
2018-02-08 13:09:51 +00:00
--
CREATE TABLE `tblDocumentReviewLog` (
`reviewLogID` INTEGER PRIMARY KEY AUTOINCREMENT,
`reviewID` INTEGER NOT NULL default 0 REFERENCES `tblDocumentReviewers` (`reviewID`) ON DELETE CASCADE,
`status` INTEGER NOT NULL default 0,
`comment` TEXT NOT NULL,
`date` TEXT NOT NULL,
`userID` INTEGER NOT NULL default 0 REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentStatus`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentStatus` (
`statusID` INTEGER PRIMARY KEY AUTOINCREMENT,
`documentID` INTEGER NOT NULL default '0' REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`version` INTEGER unsigned NOT NULL default '0',
UNIQUE (`documentID`,`version`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentStatusLog`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentStatusLog` (
`statusLogID` INTEGER PRIMARY KEY AUTOINCREMENT,
`statusID` INTEGER NOT NULL default '0' REFERENCES `tblDocumentStatus` (`statusID`) ON DELETE CASCADE,
`status` INTEGER NOT NULL default '0',
`comment` text NOT NULL,
`date` TEXT NOT NULL,
2013-02-03 06:56:06 +00:00
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblGroups`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblGroups` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` varchar(50) default NULL,
`comment` text NOT NULL
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblGroupMembers`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblGroupMembers` (
`groupID` INTEGER NOT NULL default '0' REFERENCES `tblGroups` (`id`) ON DELETE CASCADE,
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`manager` INTEGER NOT NULL default '0',
UNIQUE (`groupID`,`userID`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblKeywordCategories`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblKeywordCategories` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` varchar(255) NOT NULL default '',
`owner` INTEGER NOT NULL default '0'
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblKeywords`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblKeywords` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`category` INTEGER NOT NULL default '0' REFERENCES `tblKeywordCategories` (`id`) ON DELETE CASCADE,
`keywords` text NOT NULL
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblDocumentCategory`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblDocumentCategory` (
`categoryID` INTEGER NOT NULL default '0' REFERENCES `tblCategory` (`id`) ON DELETE CASCADE,
`documentID` INTEGER NOT NULL default '0' REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblNotify`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblNotify` (
`target` INTEGER NOT NULL default '0',
`targetType` INTEGER NOT NULL default '0',
`userID` INTEGER NOT NULL default '-1',
`groupID` INTEGER NOT NULL default '-1',
UNIQUE (`target`,`targetType`,`userID`,`groupID`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
-- Table structure for table `tblSessions`
2018-02-08 13:09:51 +00:00
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblSessions` (
`id` varchar(50) PRIMARY KEY,
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`lastAccess` INTEGER NOT NULL default '0',
`theme` varchar(30) NOT NULL default '',
`language` varchar(30) NOT NULL default '',
`clipboard` text default NULL,
2021-07-21 13:24:17 +00:00
`su` INTEGER DEFAULT NULL,
`splashmsg` text default NULL
2013-02-03 06:56:06 +00:00
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblMandatoryReviewers`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblMandatoryReviewers` (
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`reviewerUserID` INTEGER NOT NULL default '0',
`reviewerGroupID` INTEGER NOT NULL default '0',
UNIQUE (`userID`,`reviewerUserID`,`reviewerGroupID`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblMandatoryApprovers`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblMandatoryApprovers` (
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`approverUserID` INTEGER NOT NULL default '0',
`approverGroupID` INTEGER NOT NULL default '0',
UNIQUE (`userID`,`approverUserID`,`approverGroupID`)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblEvents`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblEvents` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` varchar(150) default NULL,
`comment` text,
`start` INTEGER default NULL,
`stop` INTEGER default NULL,
`date` INTEGER default NULL,
`userID` INTEGER NOT NULL default '0'
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowStates`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowStates` (
2013-02-03 06:56:06 +00:00
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` text NOT NULL,
`visibility` INTEGER DEFAULT 0,
2013-02-03 06:56:06 +00:00
`maxtime` INTEGER DEFAULT 0,
`precondfunc` text DEFAULT NULL,
`documentstatus` INTEGER DEFAULT NULL
2013-02-03 06:56:06 +00:00
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowActions`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowActions` (
2013-02-03 06:56:06 +00:00
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` text NOT NULL
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflows`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflows` (
2013-02-03 06:56:06 +00:00
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` text NOT NULL,
`initstate` INTEGER NOT NULL REFERENCES `tblWorkflowStates` (`id`) ON DELETE CASCADE
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowTransitions`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowTransitions` (
2013-02-03 06:56:06 +00:00
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`workflow` INTEGER default NULL REFERENCES `tblWorkflows` (`id`) ON DELETE CASCADE,
`state` INTEGER default NULL REFERENCES `tblWorkflowStates` (`id`) ON DELETE CASCADE,
`action` INTEGER default NULL REFERENCES `tblWorkflowActions` (`id`) ON DELETE CASCADE,
`nextstate` INTEGER default NULL REFERENCES `tblWorkflowStates` (`id`) ON DELETE CASCADE,
`maxtime` INTEGER DEFAULT 0
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowTransitionUsers`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowTransitionUsers` (
2013-02-03 06:56:06 +00:00
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`transition` INTEGER default NULL REFERENCES `tblWorkflowTransitions` (`id`) ON DELETE CASCADE,
`userid` INTEGER default NULL REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowTransitionGroups`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowTransitionGroups` (
2013-02-03 06:56:06 +00:00
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`transition` INTEGER default NULL REFERENCES `tblWorkflowTransitions` (`id`) ON DELETE CASCADE,
`groupid` INTEGER default NULL REFERENCES `tblGroups` (`id`) ON DELETE CASCADE,
`minusers` INTEGER default NULL
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowLog`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowLog` (
2013-02-03 06:56:06 +00:00
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`document` INTEGER default NULL REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`version` INTEGER default NULL,
2013-02-03 06:56:06 +00:00
`workflow` INTEGER default NULL REFERENCES `tblWorkflows` (`id`) ON DELETE CASCADE,
`userid` INTEGER default NULL REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`transition` INTEGER default NULL REFERENCES `tblWorkflowTransitions` (`id`) ON DELETE CASCADE,
`date` datetime NOT NULL,
2013-02-03 06:56:06 +00:00
`comment` text
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowDocumentContent`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowDocumentContent` (
2013-02-03 06:56:06 +00:00
`parentworkflow` INTEGER DEFAULT 0,
`workflow` INTEGER DEFAULT NULL REFERENCES `tblWorkflows` (`id`) ON DELETE CASCADE,
`document` INTEGER DEFAULT NULL REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`version` INTEGER DEFAULT NULL,
`state` INTEGER DEFAULT NULL REFERENCES `tblWorkflowStates` (`id`) ON DELETE CASCADE,
`date` datetime NOT NULL
2013-02-03 06:56:06 +00:00
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblWorkflowMandatoryWorkflow`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblWorkflowMandatoryWorkflow` (
2013-02-03 06:56:06 +00:00
`userid` INTEGER default NULL REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`workflow` INTEGER default NULL REFERENCES `tblWorkflows` (`id`) ON DELETE CASCADE,
UNIQUE(userid, workflow)
) ;
-- --------------------------------------------------------
2018-02-08 13:09:51 +00:00
--
-- Table structure for table `tblVersion`
--
2013-02-03 06:56:06 +00:00
CREATE TABLE `tblVersion` (
`date` TEXT NOT NULL,
`major` INTEGER,
`minor` INTEGER,
`subminor` INTEGER
2013-02-03 06:56:06 +00:00
) ;
-- --------------------------------------------------------
--
-- Initial content for database
--
INSERT INTO `tblUsers` (`id`, `login`, `pwd`, `fullName`, `email`, `language`, `theme`, `comment`, `role`, `hidden`, `pwdExpiration`, `loginfailures`, `disabled`, `quota`, `homefolder`) VALUES (1, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'Administrator', 'info@seeddms.org', '', '', '', 1, 0, '', 0, 0, 0, NULL);
INSERT INTO `tblUsers` (`id`, `login`, `pwd`, `fullName`, `email`, `language`, `theme`, `comment`, `role`, `hidden`, `pwdExpiration`, `loginfailures`, `disabled`, `quota`, `homefolder`) VALUES (2, 'guest', NULL, 'Guest User', NULL, '', '', '', 2, 0, '', 0, 0, 0, NULL);
INSERT INTO `tblFolders` (`id`, `name`, `parent`, `folderList`, `comment`, `date`, `owner`, `inheritAccess`, `defaultAccess`, `sequence`) VALUES (1, 'DMS', NULL, '', 'DMS root', strftime('%s','now'), 1, 0, 2, 0);
INSERT INTO `tblVersion` VALUES (DATETIME(), 5, 1, 0);