From e69c82326ba8083fd6498dc7bc57b73029c86da8 Mon Sep 17 00:00:00 2001 From: jengo Date: Mon, 5 Feb 2001 15:46:35 +0000 Subject: [PATCH] Fixed upgrade script from way back when --- setup/sql/pgsql_newtables.inc.php | 7 +++---- setup/sql/pgsql_upgrade_beta.inc.php | 30 +++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/setup/sql/pgsql_newtables.inc.php b/setup/sql/pgsql_newtables.inc.php index 20e09e9043..7a171812c1 100644 --- a/setup/sql/pgsql_newtables.inc.php +++ b/setup/sql/pgsql_newtables.inc.php @@ -31,18 +31,17 @@ $phpgw_setup->db->query($sql); - $sql = "create table accounts ( + $sql = "create table phpgw_accounts ( account_id serial, account_lid varchar(25) NOT NULL, account_pwd char(32) NOT NULL, account_firstname varchar(50), account_lastname varchar(50), - account_permissions text, - account_groups varchar(30), - account_lastlogin int, + account_lastlogin int, account_lastloginfrom varchar(255), account_lastpwd_change int, account_status char(1), + account_type char(1) unique(account_lid) )"; $phpgw_setup->db->query($sql); diff --git a/setup/sql/pgsql_upgrade_beta.inc.php b/setup/sql/pgsql_upgrade_beta.inc.php index 39a4901b77..b7184b3d02 100644 --- a/setup/sql/pgsql_upgrade_beta.inc.php +++ b/setup/sql/pgsql_upgrade_beta.inc.php @@ -118,7 +118,7 @@ $phpgw_setup->db->query("drop table config"); $phpgw_setup->db->query("create table config config_name varchar(255) NOT NULL UNIQUE, config_value varchar(100) NOT NULL"); $phpgw_setup->db->query("insert into config select * from temp"); - $phpgw_setup->db->query("drop table config"); + $phpgw_setup->db->query("drop table temp"); $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.3pre5"; } @@ -897,6 +897,34 @@ $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre3"; } + $test[] = "0.9.10pre3"; + function upgrade0_9_10pre3() + { + global $phpgw_info, $phpgw_setup; + $phpgw_setup->db->query("alter table accounts rename phpgw_accounts",__LINE__,__FILE__); + $phpgw_setup->db->query("create table phpgw_temp as select account_id,account_lid, account_pwd," + . "account_firstname,account_lastname,account_lastlogin,account_lastloginfrom" + . "account_lastpwd_change,account_status from accounts",__LINE__,__FILE__); + $sql = "create table phpgw_accounts ( + account_id serial, + account_lid varchar(25) NOT NULL, + account_pwd char(32) NOT NULL, + account_firstname varchar(50), + account_lastname varchar(50), + account_lastlogin int, + account_lastloginfrom varchar(255), + account_lastpwd_change int, + account_status char(1), + account_type char(1) + unique(account_lid) + )"; + $phpgw_setup->db->query($sql); + + $phpgw_setup->db->query("insert into phpgw_accounts select * from phpgw_temp",__LINE__,__FILE__); + $phpgw_setup->db->query("drop table accounts",__LINE__,__FILE__); + + $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.10pre4"; + } reset ($test); while (list ($key, $value) = each ($test)){