update DB Structure set to primary keys for documents_tagged move client_id last for consistancy as its a foriegn key for document_tags
This commit is contained in:
41
db.sql
41
db.sql
@@ -334,6 +334,21 @@ CREATE TABLE `custom_links` (
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `document_tags`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `document_tags`;
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE `document_tags` (
|
||||||
|
`tag_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`tag_name` varchar(30) NOT NULL,
|
||||||
|
`client_id` int(11) NOT NULL,
|
||||||
|
PRIMARY KEY (`tag_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `documents`
|
-- Table structure for table `documents`
|
||||||
--
|
--
|
||||||
@@ -359,24 +374,14 @@ CREATE TABLE `documents` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `documents_tagged`;
|
DROP TABLE IF EXISTS `documents_tagged`;
|
||||||
CREATE TABLE IF NOT EXISTS `documents_tagged` (
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE `documents_tagged` (
|
||||||
`document_id` int(11) NOT NULL,
|
`document_id` int(11) NOT NULL,
|
||||||
`tag_id` int(11) NOT NULL
|
`tag_id` int(11) NOT NULL,
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
PRIMARY KEY (`document_id`,`tag_id`)
|
||||||
COMMIT;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
--
|
|
||||||
-- Table structure for table `document_tags`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `document_tags`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `document_tags` (
|
|
||||||
`tag_id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`client_id` int(11) NOT NULL,
|
|
||||||
`tag_name` varchar(15) NOT NULL,
|
|
||||||
PRIMARY KEY (`tag_id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
||||||
COMMIT;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Table structure for table `domains`
|
-- Table structure for table `domains`
|
||||||
@@ -1178,4 +1183,4 @@ CREATE TABLE `vendors` (
|
|||||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
-- Dump completed on 2022-01-04 11:34:48
|
-- Dump completed on 2022-01-05 21:36:40
|
||||||
|
|||||||
Reference in New Issue
Block a user