add tables for revision workflow

This commit is contained in:
Uwe Steinmann 2015-04-22 10:31:56 +02:00
parent a590fec967
commit ebdfc45b69
2 changed files with 66 additions and 0 deletions

View File

@ -415,6 +415,42 @@ CREATE TABLE `tblDocumentReceiptLog` (
CONSTRAINT `tblDocumentReceiptLog_user` FOREIGN KEY (`userID`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tblDocumentRevisers`
--
CREATE TABLE `tblDocumentRevisers` (
`revisionID` int(11) NOT NULL auto_increment,
`documentID` int(11) NOT NULL default '0',
`version` smallint(5) unsigned NOT NULL default '0',
`type` tinyint(4) NOT NULL default '0',
`required` int(11) NOT NULL default '0',
`startdate` datetime default NULL,
PRIMARY KEY (`revisionID`),
UNIQUE KEY `documentID` (`documentID`,`version`,`type`,`required`),
CONSTRAINT `tblDocumentRevisers_document` FOREIGN KEY (`documentID`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tblDocumentRevisionLog`
--
CREATE TABLE `tblDocumentRevisionLog` (
`revisionLogID` int(11) NOT NULL auto_increment,
`revisionID` int(11) NOT NULL default '0',
`status` tinyint(4) NOT NULL default '0',
`comment` text NOT NULL,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
`userID` int(11) NOT NULL default '0',
PRIMARY KEY (`revisionLogID`),
CONSTRAINT `tblDocumentRevisionLog_revision` FOREIGN KEY (`revisionID`) REFERENCES `tblDocumentRevisers` (`revisionID`) ON DELETE CASCADE,
CONSTRAINT `tblDocumentRevisionLog_user` FOREIGN KEY (`userID`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tblDocumentStatus`

View File

@ -361,6 +361,36 @@ CREATE TABLE `tblDocumentRecipients` (
-- --------------------------------------------------------
--
-- Table structure for table `tblDocumentRevisionLog`
--
CREATE TABLE `tblDocumentRevisionLog` (
`revisionLogID` INTEGER PRIMARY KEY AUTOINCREMENT,
`revisionID` INTEGER NOT NULL default 0 REFERENCES `tblDocumentRevisers` (`revisionID`) ON DELETE CASCADE,
`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 `tblDocumentRevisers`
--
CREATE TABLE `tblDocumentRevisers` (
`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',
UNIQUE (`documentID`,`version`,`type`,`required`)
) ;
-- --------------------------------------------------------
--
-- Table structure for table `tblDocumentStatus`
--