[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: move setting of dbversion after table creation in initial db creation sqls

git at icinga.org git at icinga.org
Wed Jan 12 15:08:41 CET 2011


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Jan 12 15:07:50 2011 +0100

move setting of dbversion after table creation in initial db creation sqls

too much work, too less coffee...

---

 module/idoutils/db/mysql/mysql.sql   |   10 +++++-----
 module/idoutils/db/oracle/oracle.sql |   10 +++++-----
 module/idoutils/db/pgsql/pgsql.sql   |    8 +++++++-
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/module/idoutils/db/mysql/mysql.sql b/module/idoutils/db/mysql/mysql.sql
index 4495dc5..381c7b6 100644
--- a/module/idoutils/db/mysql/mysql.sql
+++ b/module/idoutils/db/mysql/mysql.sql
@@ -14,11 +14,6 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
 /*!40101 SET NAMES utf8 */;
 
--- -----------------------------------------
--- set dbversion
--- -----------------------------------------
-INSERT INTO icinga_dbversion (name, version) VALUES ('idoutils', '1.3.0') ON DUPLICATE KEY UPDATE version='1.3.0';
-
 
 --
 -- Database: `icinga`
@@ -1384,6 +1379,11 @@ CREATE TABLE IF NOT EXISTS `icinga_timeperiod_timeranges` (
 
 
 -- -----------------------------------------
+-- set dbversion
+-- -----------------------------------------
+INSERT INTO icinga_dbversion (name, version) VALUES ('idoutils', '1.3.0') ON DUPLICATE KEY UPDATE version='1.3.0';
+
+-- -----------------------------------------
 -- add index (delete)
 -- -----------------------------------------
 
diff --git a/module/idoutils/db/oracle/oracle.sql b/module/idoutils/db/oracle/oracle.sql
index 25b40c2..e28ac6c 100644
--- a/module/idoutils/db/oracle/oracle.sql
+++ b/module/idoutils/db/oracle/oracle.sql
@@ -100,11 +100,6 @@ BEGIN
 END;
 /
 
--- -----------------------------------------
--- set dbversion
--- -----------------------------------------
-INSERT INTO dbversion (id, name, version) VALUES ('1', 'idoutils', '1.3.0');
-
 
 
 -- --------------------------------------------------------
@@ -1463,6 +1458,11 @@ CREATE TABLE timeperiods (
   CONSTRAINT timeperiods UNIQUE (instance_id,config_type,timeperiod_object_id)
 );
 
+-- -----------------------------------------
+-- set dbversion
+-- -----------------------------------------
+INSERT INTO dbversion (id, name, version) VALUES ('1', 'idoutils', '1.3.0');
+
 
 -- -----------------------------------------
 -- add index (delete)
diff --git a/module/idoutils/db/pgsql/pgsql.sql b/module/idoutils/db/pgsql/pgsql.sql
index bd01e45..35fcfae 100644
--- a/module/idoutils/db/pgsql/pgsql.sql
+++ b/module/idoutils/db/pgsql/pgsql.sql
@@ -42,7 +42,6 @@ END;
 $$ LANGUAGE plpgsql;
 -- HINT: su - postgres; createlang plpgsql icinga;
 
-SELECT updatedbversion('1.3.0');
 
 
 --
@@ -1408,6 +1407,13 @@ CREATE TABLE  icinga_timeperiod_timeranges (
   UNIQUE (timeperiod_id,day,start_sec,end_sec)
 ) ;
 
+
+-- -----------------------------------------
+-- set dbversion
+-- -----------------------------------------
+
+SELECT updatedbversion('1.3.0');
+
 -- -----------------------------------------
 -- add index (delete)
 -- -----------------------------------------





More information about the icinga-checkins mailing list