$patch['208']['date'] = "20090826";
$defaults = getSystemDefaults();
$patch['209']['name'] = "Populate the status, locale, and language fields in preferences table";
$patch['209']['patch'] = "UPDATE `" . TB_PREFIX . "preferences` SET index_group = '" . $defaults['preference'] . "' ;";
$patch['209']['date'] = "20090826";
$patch['210']['name'] = "Create composite primary key for invoice table";
$patch['210']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`,`id` );";
$patch['210']['date'] = "20090826";
$patch['211']['name'] = "Reset auto-increment for invoice table";
$patch['211']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` AUTO_INCREMENT = 1;";
$patch['211']['date'] = "20090826";
$patch['212']['name'] = "Copy invoice.id into invoice.index_id";
$patch['212']['patch'] = "update `" . TB_PREFIX . "invoices` set index_id = id;";
$patch['212']['date'] = "20090902";
$invoiceobj = new invoice();
$max_invoice = $invoiceobj->max();
unset($invoiceobj);
$patch['213']['name'] = "Update the index table with max invoice id - if required";
if ($max_invoice > "0") {
    $patch['213']['patch'] = "insert into `" . TB_PREFIX . "index` (id, node, sub_node, domain_id)  VALUES (" . $max_invoice . ", 'invoice', '" . $defaults['preference'] . "','1');";
} else {
    $patch['213']['patch'] = "select 1+1;";
}
$patch['213']['date'] = "20090902";
unset($defaults);
unset($max_invoice);
$patch['214']['name'] = "Add sub_node_2 to si_index table";
$patch['214']['patch'] = "ALTER TABLE  `" . TB_PREFIX . "index` ADD  `sub_node_2` VARCHAR( 255 ) NULL AFTER  `sub_node`";
$patch['214']['date'] = "20090912";
$patch['215']['name'] = "si_invoices - add composite primary key - patch removed";
#$patch['215']['patch'] = "ALTER TABLE  `".TB_PREFIX."index` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`, `id`)";
Esempio n. 2
0
$patch['208']['patch'] = "ALTER TABLE `" . TB_PREFIX . "preferences` ADD `index_group` INT( 11 ) NOT NULL ;";
$patch['208']['date'] = "20090826";
$defaults = getSystemDefaults();
$patch['209']['name'] = "Populate the status, locale, and language fields in preferences table";
$patch['209']['patch'] = "UPDATE `" . TB_PREFIX . "preferences` SET index_group = '" . $defaults['preference'] . "' ;";
$patch['209']['date'] = "20090826";
$patch['210']['name'] = "Create composite primary key for invoice table";
$patch['210']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`,`id` );";
$patch['210']['date'] = "20090826";
$patch['211']['name'] = "Reset auto-increment for invoice table";
$patch['211']['patch'] = "ALTER TABLE `" . TB_PREFIX . "invoices` AUTO_INCREMENT = 1;";
$patch['211']['date'] = "20090826";
$patch['212']['name'] = "Copy invoice.id into invoice.index_id";
$patch['212']['patch'] = "update `" . TB_PREFIX . "invoices` set index_id = id;";
$patch['212']['date'] = "20090902";
$max_invoice = invoice::max();
$patch['213']['name'] = "Update the index table with max invoice id - if required";
if ($max_invoice > "0") {
    $patch['213']['patch'] = "insert into `" . TB_PREFIX . "index` (id, node, sub_node, domain_id)  VALUES (" . $max_invoice . ", 'invoice', '" . $defaults['preference'] . "','1');";
} else {
    $patch['213']['patch'] = "select 1 from `" . TB_PREFIX . "index`;";
}
$patch['213']['date'] = "20090902";
unset($defaults);
unset($max_invoice);
$patch['214']['name'] = "Add sub_node_2 to si_index table";
$patch['214']['patch'] = "ALTER TABLE  `" . TB_PREFIX . "index` ADD  `sub_node_2` VARCHAR( 255 ) NULL AFTER  `sub_node`";
$patch['214']['date'] = "20090912";
$patch['215']['name'] = "si_invoices - add composite primary key - patch removed";
#$patch['215']['patch'] = "ALTER TABLE  `".TB_PREFIX."index` DROP PRIMARY KEY, ADD PRIMARY KEY(`domain_id`, `id`)";
#$patch['215']['patch'] = "ALTER TABLE  `".TB_PREFIX."index` ADD PRIMARY KEY(`domain_id`, `id`)";