diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 15b751fc19..fbe45b880b 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -2,7 +2,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'phpgwapi'; - $setup_info['phpgwapi']['version'] = '0.9.13.001'; + $setup_info['phpgwapi']['version'] = '0.9.13.002'; $setup_info['phpgwapi']['versions']['current_header'] = '1.16'; // $setup_info['phpgwapi']['app_order'] = '6'; diff --git a/setup/sql/mysql_newtables.inc.php b/setup/sql/mysql_newtables.inc.php index c64a72ef1d..5ff0d7dbc7 100644 --- a/setup/sql/mysql_newtables.inc.php +++ b/setup/sql/mysql_newtables.inc.php @@ -303,18 +303,18 @@ PRIMARY KEY (message_id,app_name,lang) )"; $phpgw_setup->db->query($sql); - + $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_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, - cat_name varchar(150) NOT NULL, - cat_description varchar(255) NOT NULL, - cat_data text, + cat_access varchar(7), + cat_appname varchar(50) NOT NULL, + cat_name varchar(150) NOT NULL, + cat_description varchar(255) NOT NULL, + cat_data text, PRIMARY KEY (cat_id) )"; $phpgw_setup->db->query($sql); @@ -330,7 +330,7 @@ $sql = "CREATE TABLE phpgw_notes ( note_id int(20) NOT NULL auto_increment, note_owner int(11), - note_access char(7), + note_access varchar(7), note_date int(11), note_category int(9), note_content text, @@ -354,7 +354,7 @@ )"; $phpgw_setup->db->query($sql); - $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.001'; + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.002'; $phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi']; update_version_table(); // $phpgw_setup->update_version_table(); diff --git a/setup/sql/mysql_upgrade_beta.inc.php b/setup/sql/mysql_upgrade_beta.inc.php index 4a67ae1cd3..a3807bf3dc 100644 --- a/setup/sql/mysql_upgrade_beta.inc.php +++ b/setup/sql/mysql_upgrade_beta.inc.php @@ -1685,6 +1685,17 @@ $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.001'; } + $test[] = '0.9.13.001'; + function upgrade0_9_13_001() + { + global $phpgw_info,$phpgw_setup; + + $phpgw_setup->db->query("alter table phpgw_categories modify column cat_access varchar(7)",__LINE__,__TABLE__); + $phpgw_setup->db->query("alter table phpgw_notes modify column note_access varchar(7)",__LINE__,__TABLE__); + + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.002'; + } + reset ($test); while (list ($key, $value) = each ($test)){ if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { diff --git a/setup/sql/pgsql_newtables.inc.php b/setup/sql/pgsql_newtables.inc.php index beed4ac555..126dfdd51c 100644 --- a/setup/sql/pgsql_newtables.inc.php +++ b/setup/sql/pgsql_newtables.inc.php @@ -283,7 +283,7 @@ cat_parent int DEFAULT 0, cat_level int DEFAULT 0, cat_owner int, - cat_access char(7), + cat_access varchar(7), cat_appname varchar(50) NOT NULL, cat_name varchar(150) NOT NULL, cat_description varchar(255) NOT NULL, @@ -302,7 +302,7 @@ $sql = "CREATE TABLE phpgw_notes ( note_id serial, note_owner int, - note_access char(7), + note_access varchar(7), note_date int, note_category int, note_content text @@ -323,7 +323,7 @@ )"; $phpgw_setup->db->query($sql); - $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.001'; + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.002'; $phpgw_info['setup']['oldver']['phpgwapi'] = $phpgw_info['setup']['currentver']['phpgwapi']; update_version_table(); ?> diff --git a/setup/sql/pgsql_upgrade_beta.inc.php b/setup/sql/pgsql_upgrade_beta.inc.php index a3ef454351..862130bdbd 100644 --- a/setup/sql/pgsql_upgrade_beta.inc.php +++ b/setup/sql/pgsql_upgrade_beta.inc.php @@ -1875,7 +1875,7 @@ $sql = "CREATE TABLE phpgw_notes ( note_id serial, note_owner int, - note_access char(7), + note_access char(7), note_date int, note_category int, note_content text @@ -2000,17 +2000,17 @@ $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 - )"); + 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__); @@ -2205,6 +2205,58 @@ $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.001'; } + $test[] = '0.9.13.001'; + function upgrade0_9_13_001() + { + 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(7), + 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_setup->db->query("create table phpgw_temp as select * from phpgw_notes",__LINE__,__FILE__); + + $phpgw_setup->db->query("drop sequence phpgw_notes_note_id_seq",__LINE__,__FILE__); + + $phpgw_setup->db->query("drop table phpgw_notes",__LINE__,__FILE__); + + $sql = "CREATE TABLE phpgw_notes ( + note_id serial, + note_owner int, + note_access varchar(7), + note_date int, + note_category int, + note_content text + )"; + + $phpgw_setup->db->query($sql); + + $phpgw_setup->db->query("insert into phpgw_notes select * from phpgw_temp",__LINE__,__FILE__); + + $phpgw_setup->db->query("drop table phpgw_temp",__LINE__,__FILE__); + + $phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.13.002'; + } + reset ($test); while (list ($key, $value) = each ($test)){ if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {