add table for user substitutes and not yet implemented acls

This commit is contained in:
Uwe Steinmann 2015-05-19 08:05:15 +02:00
parent d4652a614c
commit fedcdb1b99
2 changed files with 140 additions and 0 deletions

View File

@ -72,6 +72,22 @@ CREATE TABLE `tblUsers` (
-- --------------------------------------------------------
--
-- Table structure for table `tblUserSubstitutes`
--
CREATE TABLE `tblUserSubstitutes` (
`id` int(11) NOT NULL auto_increment,
`user` int(11) default null,
`substitute` int(11) default null,
PRIMARY KEY (`id`),
UNIQUE (`user`, `substitute`),
CONSTRAINT `tblUserSubstitutes_user` FOREIGN KEY (`user`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblUserSubstitutes_substitute` FOREIGN KEY (`user`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
);
-- --------------------------------------------------------
--
-- Table structure for table `tblUserPasswordRequest`
--
@ -815,6 +831,47 @@ CREATE TABLE `tblTransmittalItems` (
-- --------------------------------------------------------
--
-- Table structure for access request objects
--
CREATE TABLE `tblAros` (
`id` int(11) NOT NULL auto_increment,
`model` text NOT NULL,
`foreignid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for access control objects
--
CREATE TABLE `tblAcos` (
`id` int(11) NOT NULL auto_increment,
`model` text NOT NULL,
`foreignid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for acos/aros relation
--
CREATE TABLE `tblArosAcos` (
`id` int(11) NOT NULL auto_increment,
`aro` int(11) NOT NULL DEFAULT '0',
`aco` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE (aco, aro),
CONSTRAINT `tblArosAcos_acos` FOREIGN KEY (`aco`) REFERENCES `tblAcos` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblArosAcos_aros` FOREIGN KEY (`aro`) REFERENCES `tblAros` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for version
--

View File

@ -63,11 +63,25 @@ CREATE TABLE `tblUsers` (
`disabled` INTEGER NOT NULL default '0',
`quota` INTEGER,
`homefolder` INTEGER default '0',
`homefolder` INTEGER default '0',
UNIQUE (`login`)
);
-- --------------------------------------------------------
--
-- Table structure for table `tblUserSubstitutes`
--
CREATE TABLE `tblUserSubstitutes` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`user` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`substitute` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
UNIQUE (`user`, `substitute`)
);
-- --------------------------------------------------------
--
-- Table structure for table `tblUserPasswordRequest`
--
@ -366,6 +380,38 @@ CREATE TABLE `tblDocumentRecipients` (
-- Table structure for table `tblDocumentRevisionLog`
--
CREATE TABLE `tblDocumentRevisionLog` (
`revisionLogID` INTEGER PRIMARY KEY AUTOINCREMENT,
`revisionID` INTEGER NOT NULL default '0',
`status` INTEGER NOT NULL default '0',
`comment` TEXT NOT NULL,
`date` TEXT NOT NULL default '0000-00-00 00:00:00',
`userID` INTEGER NOT NULL default 0 REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ;
-- --------------------------------------------------------
--
-- Table structure for table `tblDocumentRevisors`
--
CREATE TABLE `tblDocumentRevisors` (
`revisionID` 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',
`startdate` TEXT default NULL,
UNIQUE KEY `documentID` (`documentID`,`version`,`type`,`required`),
CONSTRAINT `tblDocumentRevisors_document` FOREIGN KEY (`documentID`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE
);
-- --------------------------------------------------------
--
-- Table structure for table `tblDocumentRevisionLog`
--
CREATE TABLE `tblDocumentRevisionLog` (
`revisionLogID` INTEGER PRIMARY KEY AUTOINCREMENT,
`revisionID` INTEGER NOT NULL default 0 REFERENCES `tblDocumentRevisors` (`revisionID`) ON DELETE CASCADE,
@ -706,6 +752,43 @@ CREATE TABLE `tblTransmittalItems` (
-- --------------------------------------------------------
--
-- Table structure for access request objects
--
CREATE TABLE `tblAros` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`model` TEXT NOT NULL,
`foreignid` INTEGER NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ;
--
-- Table structure for access control objects
--
CREATE TABLE `tblAcos` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`model` TEXT NOT NULL,
`foreignid` INTEGER NOT NULL DEFAULT '0'
) ;
-- --------------------------------------------------------
--
-- Table structure for acos/aros relation
--
CREATE TABLE `tblArosAcos` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`aro` int(11) NOT NULL DEFAULT '0' REFERENCES `tblAros` (`id`) ON DELETE CASCADE,
`aco` int(11) NOT NULL DEFAULT '0' REFERENCES `tblAcos` (`id`) ON DELETE CASCADE,
UNIQUE (aco, aro),
) ;
-- --------------------------------------------------------
--
-- Table structure for version
--