mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
use upper case for sql keywords
This commit is contained in:
parent
ffbc685752
commit
03b3bfa4e4
|
@ -1,15 +1,15 @@
|
|||
START TRANSACTION;
|
||||
|
||||
ALTER TABLE `tblDocumentContent` ADD COLUMN `revisiondate` datetime default NULL;
|
||||
ALTER TABLE `tblDocumentContent` ADD COLUMN `revisiondate` datetime DEFAULT NULL;
|
||||
|
||||
ALTER TABLE `tblUsers` ADD COLUMN `secret` varchar(50) default NULL AFTER `pwd`;
|
||||
ALTER TABLE `tblUsers` ADD COLUMN `secret` varchar(50) DEFAULT NULL AFTER `pwd`;
|
||||
|
||||
ALTER TABLE `tblWorkflows` ADD COLUMN `layoutdata` text default NULL AFTER `initstate`;
|
||||
ALTER TABLE `tblWorkflows` ADD COLUMN `layoutdata` text DEFAULT NULL AFTER `initstate`;
|
||||
|
||||
CREATE TABLE `tblUserSubstitutes` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`user` int(11) default null,
|
||||
`substitute` int(11) default null,
|
||||
`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,
|
||||
|
@ -17,80 +17,86 @@ CREATE TABLE `tblUserSubstitutes` (
|
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `tblDocumentCheckOuts` (
|
||||
`document` int(11) NOT NULL default '0',
|
||||
`version` smallint(5) unsigned NOT NULL default '0',
|
||||
`userID` int(11) NOT NULL default '0',
|
||||
`document` int(11) NOT NULL DEFAULT '0',
|
||||
`version` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`userID` int(11) NOT NULL DEFAULT '0',
|
||||
`date` datetime NOT NULL,
|
||||
`filename` varchar(255) NOT NULL default '',
|
||||
`filename` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`document`),
|
||||
CONSTRAINT `tblDocumentCheckOuts_document` FOREIGN KEY (`document`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `tblDocumentCheckOuts_user` FOREIGN KEY (`userID`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `tblDocumentRecipients` (
|
||||
`receiptID` 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',
|
||||
`receiptID` 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',
|
||||
PRIMARY KEY (`receiptID`),
|
||||
UNIQUE KEY `documentID` (`documentID`,`version`,`type`,`required`),
|
||||
CONSTRAINT `tblDocumentRecipients_document` FOREIGN KEY (`documentID`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
CREATE INDEX `indDocumentRecipientsRequired` ON `tblDocumentRecipients` (`required`);
|
||||
|
||||
CREATE TABLE `tblDocumentReceiptLog` (
|
||||
`receiptLogID` int(11) NOT NULL auto_increment,
|
||||
`receiptID` int(11) NOT NULL default '0',
|
||||
`status` tinyint(4) NOT NULL default '0',
|
||||
`receiptLogID` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`receiptID` int(11) NOT NULL DEFAULT '0',
|
||||
`status` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`comment` text NOT NULL,
|
||||
`date` datetime NOT NULL,
|
||||
`userID` int(11) NOT NULL default '0',
|
||||
`userID` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`receiptLogID`),
|
||||
KEY `tblDocumentReceiptLog_receipt` (`receiptID`),
|
||||
KEY `tblDocumentReceiptLog_user` (`userID`),
|
||||
CONSTRAINT `tblDocumentReceiptLog_recipient` FOREIGN KEY (`receiptID`) REFERENCES `tblDocumentRecipients` (`receiptID`) ON DELETE CASCADE,
|
||||
CONSTRAINT `tblDocumentReceiptLog_user` FOREIGN KEY (`userID`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `tblDocumentRevisors` (
|
||||
`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,
|
||||
`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 `tblDocumentRevisors_document` FOREIGN KEY (`documentID`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
CREATE INDEX `indDocumentRevisorsRequired` ON `tblDocumentRevisors` (`required`);
|
||||
|
||||
CREATE TABLE `tblDocumentRevisionLog` (
|
||||
`revisionLogID` int(11) NOT NULL auto_increment,
|
||||
`revisionID` int(11) NOT NULL default '0',
|
||||
`status` tinyint(4) NOT NULL default '0',
|
||||
`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,
|
||||
`userID` int(11) NOT NULL default '0',
|
||||
`userID` int(11) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`revisionLogID`),
|
||||
KEY `tblDocumentRevisionLog_revision` (`revisionID`),
|
||||
KEY `tblDocumentRevisionLog_user` (`userID`),
|
||||
CONSTRAINT `tblDocumentRevisionLog_revision` FOREIGN KEY (`revisionID`) REFERENCES `tblDocumentRevisors` (`revisionID`) ON DELETE CASCADE,
|
||||
CONSTRAINT `tblDocumentRevisionLog_user` FOREIGN KEY (`userID`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `tblTransmittals` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` text NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`userID` int(11) NOT NULL default '0',
|
||||
`date` datetime default NULL,
|
||||
`public` tinyint(1) NOT NULL default '0',
|
||||
`userID` int(11) NOT NULL DEFAULT '0',
|
||||
`date` datetime DEFAULT NULL,
|
||||
`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;
|
||||
|
||||
CREATE TABLE `tblTransmittalItems` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`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 default NULL,
|
||||
`document` int(11) DEFAULT NULL,
|
||||
`version` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`date` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (transmittal, document, version),
|
||||
CONSTRAINT `tblTransmittalItems_document` FOREIGN KEY (`document`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
|
||||
|
@ -98,10 +104,10 @@ CREATE TABLE `tblTransmittalItems` (
|
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `tblRoles` (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`name` varchar(50) default NULL,
|
||||
`role` smallint(1) NOT NULL default '0',
|
||||
`noaccess` varchar(30) NOT NULL default '',
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) DEFAULT NULL,
|
||||
`role` smallint(1) NOT NULL DEFAULT '0',
|
||||
`noaccess` varchar(30) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE (`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
@ -150,5 +156,3 @@ CREATE TABLE `tblArosAcos` (
|
|||
UPDATE tblVersion set major=6, minor=0, subminor=0;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user