added cat_main plus cat_level to phpgw_categories

This commit is contained in:
bettina 2001-04-27 16:02:59 +00:00
parent 120bbf4544
commit b0199b263f
4 changed files with 49 additions and 3 deletions

View File

@ -304,7 +304,9 @@
$sql = "CREATE TABLE phpgw_categories (
cat_id int(9) DEFAULT '0' NOT NULL auto_increment,
cat_main int(9) DEFAULT '0' NOT NULL,
cat_parent int(9) DEFAULT '0' NOT NULL,
cat_level int(3) DEFAULT '0' NOT NULL,
cat_owner int(11) DEFAULT '0' NOT NULL,
cat_access char(7),
cat_appname varchar(50) NOT NULL,
@ -350,7 +352,7 @@
)";
$phpgw_setup->db->query($sql);
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.002';
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.003';
$phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi'];
update_version_table();
// $phpgw_setup->update_version_table();

View File

@ -1561,6 +1561,18 @@
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.002';
}
$test[] = '0.9.11.002';
function upgrade0_9_11_002()
{
global $phpgw_info,$phpgw_setup;
$phpgw_setup->db->query("alter table phpgw_categories add column cat_main int(9) default '0' not null after cat_id",__LINE__,__FILE__);
$phpgw_setup->db->query("alter table phpgw_categories add column cat_level int(9) default '0' not null after cat_parent",__LINE__,__FILE__);
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.003';
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -276,7 +276,9 @@
$sql = "CREATE TABLE phpgw_categories (
cat_id serial,
cat_parent int,
cat_main int,
cat_parent int DEFAULT 0,
cat_level int DEFAULT 0,
cat_owner int,
cat_access char(7),
cat_appname varchar(50) NOT NULL,
@ -318,7 +320,7 @@
)";
$phpgw_setup->db->query($sql);
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.002';
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.003';
$phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi'];
update_version_table();
?>

View File

@ -1989,6 +1989,36 @@
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.002';
}
$test[] = '0.9.11.002';
function upgrade0_9_11_002() {
global $phpgw_info, $phpgw_setup;
$phpgw_setup->db->query("create table temp as select * from phpgw_categories",__LINE__,__FILE__);
$phpgw_setup->db->query("drop sequence phpgw_categories_cat_id_seq",__LINE__,__FILE__);
$phpgw_setup->db->query("drop table phpgw_categories",__LINE__,__FILE__);
$phpgw_setup->db->query("CREATE TABLE phpgw_categories (
cat_id serial,
cat_main int,
cat_parent int DEFAULT 0,
cat_level int DEFAULT 0,
cat_owner int,
cat_access varchar(25),
cat_appname varchar(50) NOT NULL,
cat_name varchar(150) NOT NULL,
cat_description varchar(255) NOT NULL,
cat_data text
)");
$phpgw_setup->db->query("insert into phpgw_categories select * from temp",__LINE__,__FILE__);
$phpgw_setup->db->query("drop table temp",__LINE__,__FILE__);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.11.003";
}
reset ($test);
while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {