Hopefully fix this upgrade for pgsql re: contacts

This commit is contained in:
Miles Lott 2001-03-16 03:06:43 +00:00
parent b1c830af8c
commit 6ce722bb0a
2 changed files with 7 additions and 1 deletions

View File

@ -151,7 +151,8 @@
email varchar(64),
email_type varchar(32) DEFAULT 'INTERNET',
email_home varchar(64),
email_home_type varchar(32) DEFAULT 'INTERNET'
email_home_type varchar(32) DEFAULT 'INTERNET',
primary key (id),
unique(id)
)";

View File

@ -1452,6 +1452,9 @@
global $phpgw_info, $phpgw_setup;
$db1 = $phpgw_setup->db;
$phpgw_setup->db->query("drop sequence phpgw_addressbook_id_seq");
$phpgw_setup->db->query("create sequence phpgw_addressbook_temp_id_seq_");
$sql="CREATE TABLE phpgw_addressbook_temp (
id serial,
lid varchar(32),
@ -1503,6 +1506,7 @@
email_type varchar(32) DEFAULT 'INTERNET',
email_home varchar(64),
email_home_type varchar(32) DEFAULT 'INTERNET',
PRIMARY KEY (id),
UNIQUE id (id)
)";
@ -1545,6 +1549,7 @@
$phpgw_setup->db->query("DROP TABLE phpgw_addressbook");
$phpgw_setup->db->query("ALTER TABLE phpgw_addressbook_temp RENAME TO phpgw_addressbook",__LINE__,__FILE__);
$phpgw_setup->db->query("ALTER SEQUENCE phpgw_addressbook_temp_id_seq RENAME TO phpgw_addressbook_id_seq",__LINE__,__FILE__);
$sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='mphone'";
$phpgw_setup->db->query($sql,__LINE__,__FILE__);