Fixed upgrade script from way back when

This commit is contained in:
jengo 2001-02-05 15:46:35 +00:00
parent f6adca46c7
commit e69c82326b
2 changed files with 32 additions and 5 deletions

View File

@ -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);

View File

@ -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)){