Changed structure of tag_association table
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 3 Oct 2009 08:37:26 +0000 (08:37 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 3 Oct 2009 08:37:26 +0000 (08:37 +0000)
sql/alter2.2.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 441c9ba65855d108c004c2ff33c950b8c4e4ce74..430d3126dedfdb7eb1a482cb97118a5e6df19275 100644 (file)
@@ -124,11 +124,10 @@ CREATE TABLE `0_tags` (
 DROP TABLE IF EXISTS `0_tag_associations`;
 
 CREATE TABLE `0_tag_associations` (
 DROP TABLE IF EXISTS `0_tag_associations`;
 
 CREATE TABLE `0_tag_associations` (
-  `id` int(11) NOT NULL auto_increment,
   `record_id` varchar(11) NOT NULL,
   `tag_id` int(11) NOT NULL,
   `record_id` varchar(11) NOT NULL,
   `tag_id` int(11) NOT NULL,
-  PRIMARY KEY  (`id`)
-) TYPE=MyISAM AUTO_INCREMENT=1;
+  UNIQUE KEY(`record_id`,`tag_id`)
+) TYPE=MyISAM;
 
 ALTER TABLE `0_suppliers` ADD COLUMN `phone2` varchar(30) NOT NULL default '' AFTER `phone`;
 ALTER TABLE `0_cust_branch` ADD COLUMN `phone2` varchar(30) NOT NULL default '' AFTER `phone`;
 
 ALTER TABLE `0_suppliers` ADD COLUMN `phone2` varchar(30) NOT NULL default '' AFTER `phone`;
 ALTER TABLE `0_cust_branch` ADD COLUMN `phone2` varchar(30) NOT NULL default '' AFTER `phone`;
index c9b32399ddde344f13a11d8962f4c2f2004fb655..b74d68d21ef24649def8fd142d4be834cc0225ff 100644 (file)
@@ -2090,11 +2090,10 @@ CREATE TABLE `0_tags` (
 DROP TABLE IF EXISTS `0_tag_associations`;
 
 CREATE TABLE `0_tag_associations` (
 DROP TABLE IF EXISTS `0_tag_associations`;
 
 CREATE TABLE `0_tag_associations` (
-  `id` int(11) NOT NULL auto_increment,
   `record_id` varchar(11) NOT NULL,
   `tag_id` int(11) NOT NULL,
   `record_id` varchar(11) NOT NULL,
   `tag_id` int(11) NOT NULL,
-  PRIMARY KEY  (`id`)
-) TYPE=MyISAM AUTO_INCREMENT=1;
+  UNIQUE KEY(`record_id`,`tag_id`)
+) TYPE=MyISAM;
 
 
 ### Data of table `0_tag_associations` ###
 
 
 ### Data of table `0_tag_associations` ###
index 0e7fd5b2a77abe204436953c8665ed4862f3a7ff..53f519a6d569391b2ee18dab28e331f8cc694ff1 100644 (file)
@@ -1832,11 +1832,10 @@ CREATE TABLE `0_tags` (
 DROP TABLE IF EXISTS `0_tag_associations`;
 
 CREATE TABLE `0_tag_associations` (
 DROP TABLE IF EXISTS `0_tag_associations`;
 
 CREATE TABLE `0_tag_associations` (
-  `id` int(11) NOT NULL auto_increment,
   `record_id` varchar(11) NOT NULL,
   `tag_id` int(11) NOT NULL,
   `record_id` varchar(11) NOT NULL,
   `tag_id` int(11) NOT NULL,
-  PRIMARY KEY  (`id`)
-) TYPE=MyISAM AUTO_INCREMENT=1;
+  UNIQUE KEY(`record_id`,`tag_id`)
+) TYPE=MyISAM;
 
 
 ### Data of table `0_tag_associations` ###
 
 
 ### Data of table `0_tag_associations` ###