add tables for tranmittals

This commit is contained in:
Uwe Steinmann 2015-04-27 08:16:50 +02:00
parent 654d8ac75a
commit d04786884b
2 changed files with 65 additions and 0 deletions

View File

@ -779,6 +779,41 @@ CREATE TABLE tblWorkflowMandatoryWorkflow (
-- --------------------------------------------------------
--
-- Table structure for transmittal
--
CREATE TABLE `tblTransmittals` (
`id` int(11) NOT NULL auto_increment,
`name` text NOT NULL,
`comment` text NOT NULL,
`userID` int(11) NOT NULL default '0',
`date` datetime,
`public` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`),
CONSTRAINT `tblTransmittals_user` FOREIGN KEY (`userID`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for transmittal item
--
CREATE TABLE `tblTransmittalItems` (
`id` int(11) NOT NULL auto_increment,
`transmittal` int(11) NOT NULL DEFAULT '0',
`document` int(11) default NULL,
`version` smallint(5) unsigned NOT NULL default '0',
`date` datetime,
PRIMARY KEY (`id`),
UNIQUE (document, version),
CONSTRAINT `tblTransmittalItems_document` FOREIGN KEY (`document`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
CONSTRAINT `tblTransmittalItem_transmittal` FOREIGN KEY (`transmittal`) REFERENCES `tblTransmittals` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for version
--

View File

@ -675,6 +675,36 @@ CREATE TABLE tblWorkflowMandatoryWorkflow (
-- --------------------------------------------------------
--
-- Table structure for transmittal
--
CREATE TABLE tblTransmittals (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`name` text NOT NULL,
`comment` text NOT NULL,
`userID` INTEGER NOT NULL default '0' REFERENCES `tblUsers` (`id`) ON DELETE CASCADE,
`date` TEXT NOT NULL default '0000-00-00 00:00:00',
`public` INTEGER NOT NULL default '0'
);
-- --------------------------------------------------------
--
-- Table structure for transmittal item
--
CREATE TABLE `tblTransmittalItems` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`transmittal` INTEGER NOT NULL DEFAULT '0' REFERENCES `tblTransmittals` (`id`) ON DELETE CASCADE,
`document` INTEGER default NULL REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
`version` INTEGER unsigned NOT NULL default '0',
`date` TEXT NOT NULL default '0000-00-00 00:00:00',
UNIQUE (document, version)
);
-- --------------------------------------------------------
--
-- Table structure for version
--