[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: add default upgrade sql for 1.5.0

git at icinga.org git at icinga.org
Wed Jun 29 13:50:45 CEST 2011


Module: icinga-core
Branch: mfriedrich/core
Commit: 2089091f4ab6ed07179846990fe4bfcf1fce2bf2
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=2089091f4ab6ed07179846990fe4bfcf1fce2bf2

Author: Thomas Dressler <tdressler at tdressler.net>
Date:   Sun Jun  5 18:11:23 2011 +0200

add default upgrade sql for 1.5.0

---

 .../db/mysql/upgrade/mysql-upgrade-1.5.0.sql       |   14 +++++
 .../db/oracle/upgrade/oracle-upgrade-1.5.0.sql     |   51 ++++++++++++++++++++
 .../db/pgsql/upgrade/pgsql-upgrade-1.5.0.sql       |   15 ++++++
 3 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.5.0.sql b/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.5.0.sql
new file mode 100644
index 0000000..d1ec079
--- /dev/null
+++ b/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.5.0.sql
@@ -0,0 +1,14 @@
+-- -----------------------------------------
+-- upgrade path for Icinga IDOUtils 1.5.0
+--
+-- -----------------------------------------
+-- Copyright (c) 2010-2011 Icinga Development Team (http://www.icinga.org)
+--
+-- Please check http://docs.icinga.org for upgrading information!
+-- -----------------------------------------
+-- -----------------------------------------
+-- update dbversion
+-- -----------------------------------------
+
+INSERT INTO icinga_dbversion (name, version) VALUES ('idoutils', '1.5.0') ON DUPLICATE KEY UPDATE version='1.5.0';
+
diff --git a/module/idoutils/db/oracle/upgrade/oracle-upgrade-1.5.0.sql b/module/idoutils/db/oracle/upgrade/oracle-upgrade-1.5.0.sql
new file mode 100644
index 0000000..004b7d8
--- /dev/null
+++ b/module/idoutils/db/oracle/upgrade/oracle-upgrade-1.5.0.sql
@@ -0,0 +1,51 @@
+-- -----------------------------------------
+-- upgrade path for Icinga IDOUtils 1.5.0
+--
+-- run it as icinga database user whithin  current directory 
+-- sqlplus icinga@<instance> @ oracle-upgrade.1-5.0.sql
+-- -----------------------------------------
+-- Copyright (c) 2010-2011 Icinga Development Team (http://www.icinga.org)
+--
+-- Please check http://docs.icinga.org for upgrading information!
+-- -----------------------------------------
+set sqlprompt "&&_USER@&&_CONNECT_IDENTIFIER SQL>"
+set pagesize 200;
+set linesize 200;
+set heading on;
+set echo on;
+set feedback on;
+
+define ICINGA_VERSION=1.5.0
+
+-- --------------------------------------------------------
+-- warning:edit this script to define existing tablespaces
+-- this particular step can be skipped safetly
+-- --------------------------------------------------------
+/* set real TBS names on which you have quota, no checks are implemented!*/
+define DATATBS='ICINGA_DATA1';
+define LOBTBS='ICINGA_LOB1';
+define IXTBS='ICINGA_IDX1';
+
+/* script will be terminated on the first error */
+whenever sqlerror exit failure
+spool oracle-upgrade-&&ICINGA_VERSION..log
+
+
+-- -----------------------------------------
+-- finally update dbversion
+-- -----------------------------------------
+
+MERGE INTO dbversion
+	USING DUAL ON (name='idoutils')
+	WHEN MATCHED THEN
+		UPDATE SET version='&&ICINGA_VERSION'
+	WHEN NOT MATCHED THEN
+		INSERT (id, name, version) VALUES ('1', 'idoutils', '&&ICINGA_VERSION');
+
+/* last check */
+select object_name,object_type,status  from user_objects where status !='VALID';
+
+/* goodbye */
+spool off 
+exit;
+
diff --git a/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.5.0.sql b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.5.0.sql
new file mode 100644
index 0000000..c383f86
--- /dev/null
+++ b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.5.0.sql
@@ -0,0 +1,15 @@
+-- -----------------------------------------
+-- upgrade path for Icinga IDOUtils 1.5.0
+--
+-- -----------------------------------------
+-- Copyright (c) 2010-2011 Icinga Development Team (http://www.icinga.org)
+--
+-- Please check http://docs.icinga.org for upgrading information!
+-- -----------------------------------------
+
+-- -----------------------------------------
+-- update dbversion
+-- -----------------------------------------
+
+SELECT updatedbversion('1.5.0');  
+





More information about the icinga-checkins mailing list