Upgrade for adding table structure for calendar holidays

This commit is contained in:
skeeter 2001-04-30 03:04:02 +00:00
parent 5cf7a13846
commit ecf1d3bc66
7 changed files with 59 additions and 8 deletions

View File

@ -40,9 +40,10 @@
$phpgw_setup->db->query("DROP TABLE phpgw_cal"); $phpgw_setup->db->query("DROP TABLE phpgw_cal");
$phpgw_setup->db->query("DROP TABLE phpgw_cal_user"); $phpgw_setup->db->query("DROP TABLE phpgw_cal_user");
$phpgw_setup->db->query("DROP TABLE phpgw_cal_repeats"); $phpgw_setup->db->query("DROP TABLE phpgw_cal_repeats");
$phpgw_setup->db->query("DROP TABLE calendar_entry"); $phpgw_setup->db->query("DROP TABLE phpgw_cal_holidays");
$phpgw_setup->db->query("DROP TABLE calendar_entry_user"); @$phpgw_setup->db->query("DROP TABLE calendar_entry");
$phpgw_setup->db->query("DROP TABLE calendar_entry_repeats"); @$phpgw_setup->db->query("DROP TABLE calendar_entry_user");
@$phpgw_setup->db->query("DROP TABLE calendar_entry_repeats");
/* Legacy tables */ /* Legacy tables */

View File

@ -245,7 +245,15 @@
)"; )";
$phpgw_setup->db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE newsgroups ( $sql = "CREATE TABLE phpgw_cal_holidays (
locale char(2) NOT NULL,
name varchar(50) NOT NULL,
date_time int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (locale,name)
)";
$phpgw_setup->db->query($sql);
$sql = "CREATE TABLE newsgroups (
con int(11) NOT NULL auto_increment, con int(11) NOT NULL auto_increment,
name varchar(255) NOT NULL, name varchar(255) NOT NULL,
messagecount int(11) NOT NULL, messagecount int(11) NOT NULL,

View File

@ -1573,6 +1573,23 @@
} }
$test[] = '0.9.11.003';
function upgrade0_9_11_003()
{
global $phpgw_info,$phpgw_setup;
$sql = "CREATE TABLE phpgw_cal_holidays (
locale char(2) NOT NULL,
name varchar(50) NOT NULL,
date_time int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (locale,name)
)";
$phpgw_setup->db->query($sql,__LINE__,__FILE__);
$phpgw_info['setup']['currentver']['phpgwapi'] = '0.9.11.004';
}
reset ($test); reset ($test);
while (list ($key, $value) = each ($test)){ while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -35,6 +35,8 @@
$phpgw_setup->db->query("DROP TABLE phpgw_cal"); $phpgw_setup->db->query("DROP TABLE phpgw_cal");
$phpgw_setup->db->query("DROP TABLE phpgw_cal_user"); $phpgw_setup->db->query("DROP TABLE phpgw_cal_user");
$phpgw_setup->db->query("DROP TABLE phpgw_cal_repeats"); $phpgw_setup->db->query("DROP TABLE phpgw_cal_repeats");
$phpgw_setup->db->query("DROP TABLE phpgw_cal_holidays");
$phpgw_setup->db->query("drop sequence phpgw_cal_cal_id_seq"); $phpgw_setup->db->query("drop sequence phpgw_cal_cal_id_seq");
$phpgw_setup->db->query("DROP TABLE phpgw_nextid"); $phpgw_setup->db->query("DROP TABLE phpgw_nextid");
@ -47,9 +49,9 @@
$phpgw_setup->db->query("DROP TABLE phpgw_cal"); $phpgw_setup->db->query("DROP TABLE phpgw_cal");
$phpgw_setup->db->query("DROP TABLE phpgw_cal_user"); $phpgw_setup->db->query("DROP TABLE phpgw_cal_user");
$phpgw_setup->db->query("DROP TABLE phpgw_cal_repeats"); $phpgw_setup->db->query("DROP TABLE phpgw_cal_repeats");
$phpgw_setup->db->query("DROP TABLE calendar_entry"); @$phpgw_setup->db->query("DROP TABLE calendar_entry");
$phpgw_setup->db->query("DROP TABLE calendar_entry_user"); @$phpgw_setup->db->query("DROP TABLE calendar_entry_user");
$phpgw_setup->db->query("DROP TABLE calendar_entry_repeats"); @$phpgw_setup->db->query("DROP TABLE calendar_entry_repeats");
$phpgw_setup->db->query("DROP sequence phpgw_cal_id_seq"); $phpgw_setup->db->query("DROP sequence phpgw_cal_id_seq");
$phpgw_setup->db->query("drop sequence calendar_entry_cal_id_seq"); $phpgw_setup->db->query("drop sequence calendar_entry_cal_id_seq");

View File

@ -218,6 +218,14 @@
)"; )";
$phpgw_setup->db->query($sql); $phpgw_setup->db->query($sql);
$sql = "CREATE TABLE phpgw_cal_holidays (
locale char(2) NOT NULL,
name varchar(50) NOT NULL,
date_time int4 DEFAULT 0 NOT NULL,
PRIMARY KEY (locale,name)
)";
$phpgw_setup->db->query($sql);
$sql = "CREATE TABLE newsgroups ( $sql = "CREATE TABLE newsgroups (
con serial, con serial,
name varchar(255) NOT NULL, name varchar(255) NOT NULL,

View File

@ -2019,6 +2019,21 @@
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.11.003"; $phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.11.003";
} }
$test[] = '0.9.11.003';
function upgrade0_9_11_003()
{
global $phpgw_info, $phpgw_setup;
$sql = "CREATE TABLE phpgw_cal_holidays (
locale char(2) NOT NULL,
name varchar(50) NOT NULL,
date_time int4 DEFAULT 0 NOT NULL,
PRIMARY KEY (locale,name)
)";
$phpgw_setup->db->query($sql);
$phpgw_info["setup"]["currentver"]["phpgwapi"] = "0.9.11.004";
}
reset ($test); reset ($test);
while (list ($key, $value) = each ($test)){ while (list ($key, $value) = each ($test)){
if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) {

View File

@ -11,5 +11,5 @@
/* $Id$ */ /* $Id$ */
$phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.003'; $phpgw_info['server']['versions']['phpgwapi'] = '0.9.11.004';
$phpgw_info['server']['versions']['current_header'] = '1.11'; $phpgw_info['server']['versions']['current_header'] = '1.11';