Tags support related changes.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 21 Sep 2009 19:58:00 +0000 (19:58 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Mon, 21 Sep 2009 19:58:00 +0000 (19:58 +0000)
sql/alter2.2.php
sql/alter2.2.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 21fa6822c7f5492f927e7a05739811b0e65c9c9d..30219a7079c9cd0ebbbef04543198e09b80f070d 100644 (file)
@@ -116,7 +116,7 @@ class fa2_2 {
        //      Test if patch was applied before.
        //
        function installed($pref) {
-               $n = 14; // number of features to be installed
+               $n = 15; // number of features to be installed
                if (check_table($pref, 'company', 'custom1_name')) $n--;
                if (!check_table($pref, 'company', 'profit_loss_year_act')) $n--;
                if (!check_table($pref, 'company', 'login_tout')) $n--;
@@ -131,7 +131,8 @@ class fa2_2 {
                if (!check_table($pref, 'suppliers', 'supp_ref')) $n--;
                if (!check_table($pref, 'users', 'role_id')) $n--;
                if (!check_table($pref, 'sales_orders', 'reference')) $n--;
-               return $n == 0 ? true : 14 - $n;
+               if (!check_table($pref, 'tags')) $n--;
+               return $n == 0 ? true : 15 - $n;
        }
 };
 
index a4d70802123690d67dcd34bb1c13a1f8c1153740..6fd520b874a6ffc584ae2d22f6242173a102f301 100644 (file)
@@ -108,3 +108,23 @@ UPDATE `0_sales_orders`    SET `reference`=`order_no` WHERE 1;
 INSERT INTO `0_sys_types` (`type_id`, `type_no`, `next_reference`) VALUES (32, 0, '1');
 
 ALTER TABLE `0_bank_accounts` ADD COLUMN `dflt_curr_act` TINYINT(1) NOT NULL default '0' AFTER `bank_curr_code`;
+
+DROP TABLE IF EXISTS `0_tags`;
+
+CREATE TABLE `0_tags` (
+  `id` int(11) NOT NULL auto_increment,
+  `type` smallint(6) NOT NULL,
+  `name` varchar(60) NOT NULL,
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY(`type`,`name`)
+) TYPE=MyISAM AUTO_INCREMENT=1;
+
+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,
+  PRIMARY KEY  (`id`)
+) TYPE=MyISAM AUTO_INCREMENT=1;
+
index d4dfdd325380920b8f7e6822298c5662696ae7c7..05ba73da134c7efd362f962da6cc7e5eb80cae8c 100644 (file)
@@ -2059,3 +2059,34 @@ INSERT INTO `0_workorders` VALUES ('5', '5', 'DEF', '5', '3400', '2009-06-21', '
 INSERT INTO `0_workorders` VALUES ('6', '6', 'DEF', '-5', '3400', '2009-06-21', '1', '2009-06-21', '2009-06-21', '-5', '1', '1', '0');
 INSERT INTO `0_workorders` VALUES ('7', '7', 'DEF', '-2', '3400', '2009-06-21', '1', '2009-06-21', '2009-06-21', '-2', '1', '1', '10');
 
+
+### Structure of table `0_tags` ###
+
+DROP TABLE IF EXISTS `0_tags`;
+
+CREATE TABLE `0_tags` (
+  `id` int(11) NOT NULL auto_increment,
+  `type` smallint(6) NOT NULL,
+  `name` varchar(60) NOT NULL,
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY(`type`,`name`)
+) TYPE=MyISAM AUTO_INCREMENT=1;
+
+
+### Data of table `0_chart_tags` ###
+
+
+
+### Structure of 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,
+  PRIMARY KEY  (`id`)
+) TYPE=MyISAM AUTO_INCREMENT=1;
+
+
+### Data of table `0_tag_associations` ###
index b2c16a91937960787a29e045dfa91c7d59f6d9a3..4a09214fa31a07f0d6b7b34b26518e8177667c61 100644 (file)
@@ -1800,3 +1800,35 @@ CREATE TABLE `0_workorders` (
 
 ### Data of table `0_workorders` ###
 
+
+
+### Structure of table `0_tags` ###
+
+DROP TABLE IF EXISTS `0_tags`;
+
+CREATE TABLE `0_tags` (
+  `id` int(11) NOT NULL auto_increment,
+  `type` smallint(6) NOT NULL,
+  `name` varchar(60) NOT NULL,
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY(`type`,`name`)
+) TYPE=MyISAM AUTO_INCREMENT=1;
+
+
+### Data of table `0_chart_tags` ###
+
+
+
+### Structure of 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,
+  PRIMARY KEY  (`id`)
+) TYPE=MyISAM AUTO_INCREMENT=1;
+
+
+### Data of table `0_tag_associations` ###