From ecf1d3bc6662d707f415e86981f1ec996c8ae482 Mon Sep 17 00:00:00 2001 From: skeeter Date: Mon, 30 Apr 2001 03:04:02 +0000 Subject: [PATCH] Upgrade for adding table structure for calendar holidays --- setup/sql/mysql_droptables.inc.php | 7 ++++--- setup/sql/mysql_newtables.inc.php | 10 +++++++++- setup/sql/mysql_upgrade_beta.inc.php | 17 +++++++++++++++++ setup/sql/pgsql_droptables.inc.php | 8 +++++--- setup/sql/pgsql_newtables.inc.php | 8 ++++++++ setup/sql/pgsql_upgrade_beta.inc.php | 15 +++++++++++++++ version.inc.php | 2 +- 7 files changed, 59 insertions(+), 8 deletions(-) diff --git a/setup/sql/mysql_droptables.inc.php b/setup/sql/mysql_droptables.inc.php index b46e18ecad..1d5a1d8607 100644 --- a/setup/sql/mysql_droptables.inc.php +++ b/setup/sql/mysql_droptables.inc.php @@ -40,9 +40,10 @@ $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_repeats"); - $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_repeats"); + $phpgw_setup->db->query("DROP TABLE phpgw_cal_holidays"); + @$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_repeats"); /* Legacy tables */ diff --git a/setup/sql/mysql_newtables.inc.php b/setup/sql/mysql_newtables.inc.php index 2f0e8e4b46..70b75030a0 100644 --- a/setup/sql/mysql_newtables.inc.php +++ b/setup/sql/mysql_newtables.inc.php @@ -245,7 +245,15 @@ )"; $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, name varchar(255) NOT NULL, messagecount int(11) NOT NULL, diff --git a/setup/sql/mysql_upgrade_beta.inc.php b/setup/sql/mysql_upgrade_beta.inc.php index e0df408280..7267140d9a 100644 --- a/setup/sql/mysql_upgrade_beta.inc.php +++ b/setup/sql/mysql_upgrade_beta.inc.php @@ -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); while (list ($key, $value) = each ($test)){ if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { diff --git a/setup/sql/pgsql_droptables.inc.php b/setup/sql/pgsql_droptables.inc.php index d91b9fe234..26e58cc224 100644 --- a/setup/sql/pgsql_droptables.inc.php +++ b/setup/sql/pgsql_droptables.inc.php @@ -35,6 +35,8 @@ $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_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 TABLE phpgw_nextid"); @@ -47,9 +49,9 @@ $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_repeats"); - $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_repeats"); + @$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_repeats"); $phpgw_setup->db->query("DROP sequence phpgw_cal_id_seq"); $phpgw_setup->db->query("drop sequence calendar_entry_cal_id_seq"); diff --git a/setup/sql/pgsql_newtables.inc.php b/setup/sql/pgsql_newtables.inc.php index 49f3233947..53f92be93c 100644 --- a/setup/sql/pgsql_newtables.inc.php +++ b/setup/sql/pgsql_newtables.inc.php @@ -218,6 +218,14 @@ )"; $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 ( con serial, name varchar(255) NOT NULL, diff --git a/setup/sql/pgsql_upgrade_beta.inc.php b/setup/sql/pgsql_upgrade_beta.inc.php index 3e44688ec6..67003e8cf6 100644 --- a/setup/sql/pgsql_upgrade_beta.inc.php +++ b/setup/sql/pgsql_upgrade_beta.inc.php @@ -2019,6 +2019,21 @@ $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); while (list ($key, $value) = each ($test)){ if ($phpgw_info["setup"]["currentver"]["phpgwapi"] == $value) { diff --git a/version.inc.php b/version.inc.php index e1a35a5f85..1cf15edef2 100644 --- a/version.inc.php +++ b/version.inc.php @@ -11,5 +11,5 @@ /* $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';