From 2916061723b7db16539237b22abf487066cfbf36 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 21 Sep 2009 19:58:00 +0000 Subject: [PATCH] Tags support related changes. --- sql/alter2.2.php | 5 +++-- sql/alter2.2.sql | 20 ++++++++++++++++++++ sql/en_US-demo.sql | 31 +++++++++++++++++++++++++++++++ sql/en_US-new.sql | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 2 deletions(-) diff --git a/sql/alter2.2.php b/sql/alter2.2.php index 21fa6822..30219a70 100644 --- a/sql/alter2.2.php +++ b/sql/alter2.2.php @@ -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; } }; diff --git a/sql/alter2.2.sql b/sql/alter2.2.sql index a4d70802..6fd520b8 100644 --- a/sql/alter2.2.sql +++ b/sql/alter2.2.sql @@ -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; + diff --git a/sql/en_US-demo.sql b/sql/en_US-demo.sql index d4dfdd32..05ba73da 100644 --- a/sql/en_US-demo.sql +++ b/sql/en_US-demo.sql @@ -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` ### diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index b2c16a91..4a09214f 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -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` ### -- 2.30.2