mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 05:01:43 +00:00
- change order of which tables are created to make constraints work
- added constraints to tblDocumentCategory
This commit is contained in:
parent
b488016820
commit
2ae7e9de6a
|
@ -14,6 +14,18 @@ CREATE TABLE `tblACLs` (
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `tblCategory`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `tblCategory` (
|
||||||
|
`id` int(11) NOT NULL auto_increment,
|
||||||
|
`name` text NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `tblAttributeDefinitions`
|
-- Table structure for table `tblAttributeDefinitions`
|
||||||
--
|
--
|
||||||
|
@ -432,25 +444,15 @@ CREATE TABLE `tblKeywords` (
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `tblCategory`
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE TABLE `tblCategory` (
|
|
||||||
`id` int(11) NOT NULL auto_increment,
|
|
||||||
`name` text NOT NULL,
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `tblDocumentCategory`
|
-- Table structure for table `tblDocumentCategory`
|
||||||
--
|
--
|
||||||
|
|
||||||
CREATE TABLE `tblDocumentCategory` (
|
CREATE TABLE `tblDocumentCategory` (
|
||||||
`categoryID` int(11) NOT NULL default 0,
|
`categoryID` int(11) NOT NULL default 0,
|
||||||
`documentID` int(11) NOT NULL default 0
|
`documentID` int(11) NOT NULL default 0,
|
||||||
|
CONSTRAINT `tblDocumentCategory_category` FOREIGN KEY (`categoryID`) REFERENCES `tblCategory` (`id`) ON DELETE CASCADE,
|
||||||
|
CONSTRAINT `tblDocumentCategory_document` FOREIGN KEY (`documentID`) REFERENCES `tblDocuments` (`id`) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user