// 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--;
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;
}
};
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;
+
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` ###
### 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` ###