mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-30 19:33:34 +00:00
46 lines
1.9 KiB
SQL
46 lines
1.9 KiB
SQL
START TRANSACTION;
|
|
|
|
CREATE TABLE `tblDownloadLinks` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`document` int(11) NOT NULL DEFAULT '0',
|
|
`version` smallint(5) unsigned NOT NULL DEFAULT '0',
|
|
`userID` int(11) NOT NULL DEFAULT '0',
|
|
`hash` varchar(50) DEFAULT NULL,
|
|
`valid` datetime DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
CONSTRAINT `tblDownloadLink_document` FOREIGN KEY (`document`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE,
|
|
CONSTRAINT `tblDownloadLink_user` FOREIGN KEY (`userID`) REFERENCES `tblUsers` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE `tblAttributeDefinitionGroups` (
|
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
|
`name` varchar(100) DEFAULT NULL,
|
|
`comment` text,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `name` (`name`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE `tblAttributeDefinitionGroupAttributeDefinition` (
|
|
`attrdef` int(11),
|
|
`attrgrp` int(11),
|
|
`sequence` double NOT NULL DEFAULT '0',
|
|
`show` int(11),
|
|
UNIQUE KEY `attrdef` (`attrdef`,`attrgrp`),
|
|
CONSTRAINT `tblAttributeDefinitionGroupAttributeDefinition_attrdef` FOREIGN KEY (`attrdef`) REFERENCES `tblAttributeDefinitions` (`id`) ON DELETE CASCADE,
|
|
CONSTRAINT `tblAttributeDefinitionGroupAttributeDefinition_attrgrp` FOREIGN KEY (`attrgrp`) REFERENCES `tblAttributeDefinitionGroups` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE `tblFolderAttributeDefinitionGroup` (
|
|
`folder` int(11),
|
|
`attrgrp` int(11),
|
|
`sequence` double NOT NULL DEFAULT '0',
|
|
UNIQUE KEY `folder` (`folder`,`attrgrp`),
|
|
CONSTRAINT `tblFolderAttributeDefinitionGroup_folder` FOREIGN KEY (`folder`) REFERENCES `tblFolders` (`id`) ON DELETE CASCADE,
|
|
CONSTRAINT `tblFolderAttributeDefinitionGroup_attrgrp` FOREIGN KEY (`attrgrp`) REFERENCES `tblAttributeDefinitionGroups` (`id`) ON DELETE CASCADE
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
UPDATE tblVersion set major=6, minor=1, subminor=0;
|
|
|
|
COMMIT;
|
|
|