[icinga-checkins] icinga.org: icinga-web/support/1.9: schema: update to 1.9.0, add upgrade scripts for fresh install upgrades

git at icinga.org git at icinga.org
Thu Jun 27 19:55:11 CEST 2013


Module: icinga-web
Branch: support/1.9
Commit: 6f959b9aa30cf3c28959ebe552501031933fc5b0
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=6f959b9aa30cf3c28959ebe552501031933fc5b0

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Thu Jun 27 19:54:28 2013 +0200

schema: update to 1.9.0, add upgrade scripts for fresh install upgrades

fixes #4309

---

 etc/schema/mysql.sql                               |    2 +-
 etc/schema/oracle.sql                              |    2 +-
 etc/schema/pgsql.sql                               |    2 +-
 etc/schema/updates/mysql/mysql_v1-9-0_to_1-9-1.sql |    3 +++
 .../updates/oracle/oracle_v1-9-0_to_v1-9-1.sql     |   10 ++++++++++
 .../updates/pgsql/pgsql_v1-9-0_to_v1-9-1.sql       |    2 ++
 6 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/etc/schema/mysql.sql b/etc/schema/mysql.sql
index 6b7a2c4..f6a4a0a 100644
--- a/etc/schema/mysql.sql
+++ b/etc/schema/mysql.sql
@@ -42,7 +42,7 @@ ALTER TABLE nsm_user_role ADD CONSTRAINT nsm_user_role_usro_role_id_nsm_role_rol
 /*          Initial data import              */
  
 INSERT INTO nsm_user (user_id,user_account,user_name,user_firstname,user_lastname,user_password,user_salt,user_authsrc,user_email,user_disabled,user_modified,user_created) VALUES ('1','0','root','Enoch','Root','42bc5093863dce8c150387a5bb7e3061cf3ea67d2cf1779671e1b0f435e953a1','0c099ae4627b144f3a7eaa763ba43b10fd5d1caa8738a98f11bb973bebc52ccd','internal','root at localhost.local','0', NOW(), NOW());
-INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.3', NOW(), NOW());
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.9.0', NOW(), NOW());
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('1','IcingaHostgroup','Limit data access to specific hostgroups','IcingaDataHostgroupPrincipalTarget','icinga');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('2','IcingaServicegroup','Limit data access to specific servicegroups','IcingaDataServicegroupPrincipalTarget','icinga');
 INSERT INTO nsm_target (target_id,target_name,target_description,target_class,target_type) VALUES ('3','IcingaHostCustomVariablePair','Limit data access to specific custom variables','IcingaDataHostCustomVariablePrincipalTarget','icinga');
diff --git a/etc/schema/oracle.sql b/etc/schema/oracle.sql
index e1595b4..669175a 100644
--- a/etc/schema/oracle.sql
+++ b/etc/schema/oracle.sql
@@ -618,7 +618,7 @@ INSERT INTO nsm_target (target_id,target_name,target_description,target_class,ta
 
 INSERT INTO nsm_user (user_id,user_account,user_name,user_firstname,user_lastname,user_password,user_salt,user_authsrc,user_email,user_disabled,user_created,user_modified) VALUES ('1','0','root','Enoch','Root','42bc5093863dce8c150387a5bb7e3061cf3ea67d2cf1779671e1b0f435e953a1','0c099ae4627b144f3a7eaa763ba43b10fd5d1caa8738a98f11bb973bebc52ccd','internal','root at localhost.local','0',sysdate,sysdate);
 
-INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.8.3', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.9.0', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
 
 INSERT INTO nsm_principal (principal_id,principal_user_id,principal_type,principal_disabled) VALUES ('1','1','user','0');
 INSERT INTO nsm_principal (principal_id,principal_role_id,principal_type,principal_disabled) VALUES ('2','2','role','0');
diff --git a/etc/schema/pgsql.sql b/etc/schema/pgsql.sql
index 3fee260..adda4c0 100644
--- a/etc/schema/pgsql.sql
+++ b/etc/schema/pgsql.sql
@@ -654,7 +654,7 @@ COPY cronk_principal_cronk (cpc_principal_id, cpc_cronk_id) FROM stdin;
 --
 
 COPY nsm_db_version (id, version, modified, created) FROM stdin;
-1	icinga-web/v1.8.3	2013-03-25 00:00:00	2013-03-23 00:00:00
+1	icinga-web/v1.9.0	2013-03-25 00:00:00	2013-03-23 00:00:00
 \.
 
 
diff --git a/etc/schema/updates/mysql/mysql_v1-9-0_to_1-9-1.sql b/etc/schema/updates/mysql/mysql_v1-9-0_to_1-9-1.sql
new file mode 100644
index 0000000..323505a
--- /dev/null
+++ b/etc/schema/updates/mysql/mysql_v1-9-0_to_1-9-1.sql
@@ -0,0 +1,3 @@
+-- Default version change
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.9.0', NOW(), NOW());
diff --git a/etc/schema/updates/oracle/oracle_v1-9-0_to_v1-9-1.sql b/etc/schema/updates/oracle/oracle_v1-9-0_to_v1-9-1.sql
new file mode 100644
index 0000000..061e28d
--- /dev/null
+++ b/etc/schema/updates/oracle/oracle_v1-9-0_to_v1-9-1.sql
@@ -0,0 +1,10 @@
+--error handler
+whenever sqlerror exit failure
+
+-- Default version bump
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.9.0', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
+
+--final commit
+commit;
+
diff --git a/etc/schema/updates/pgsql/pgsql_v1-9-0_to_v1-9-1.sql b/etc/schema/updates/pgsql/pgsql_v1-9-0_to_v1-9-1.sql
new file mode 100644
index 0000000..106b7d1
--- /dev/null
+++ b/etc/schema/updates/pgsql/pgsql_v1-9-0_to_v1-9-1.sql
@@ -0,0 +1,2 @@
+DELETE FROM nsm_db_version;
+INSERT INTO nsm_db_version VALUES ('1','icinga-web/v1.9.0', NOW(), NOW());





More information about the icinga-checkins mailing list