[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: change display_name to varchar(255 ) for mysql/oracle

git at icinga.org git at icinga.org
Tue Jul 27 15:04:16 CEST 2010


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Tue Jul 27 15:02:44 2010 +0200

change display_name to varchar(255) for mysql/oracle

pgsql will be changed to text

refs #642

---

 module/idoutils/db/mysql/mysql-upgrade-1.0.3.sql   |   12 ++++++++++++
 module/idoutils/db/mysql/mysql.sql                 |    4 ++--
 module/idoutils/db/oracle/oracle-upgrade-1.0.3.sql |   19 +++++++++++++++++++
 module/idoutils/db/oracle/oracle.sql               |   18 +++++++++---------
 4 files changed, 42 insertions(+), 11 deletions(-)

diff --git a/module/idoutils/db/mysql/mysql-upgrade-1.0.3.sql b/module/idoutils/db/mysql/mysql-upgrade-1.0.3.sql
new file mode 100644
index 0000000..541d951
--- /dev/null
+++ b/module/idoutils/db/mysql/mysql-upgrade-1.0.3.sql
@@ -0,0 +1,12 @@
+-- --------------------------------------------------------
+-- mysql-upgrade-1.0.2.sql
+-- DB definition for MySQL
+--
+-- modify display_name to varchar(255)
+--
+-- -- --------------------------------------------------------
+
+ALTER TABLE `icinga_hosts` MODIFY COLUMN `display_name` varchar(255) NOT NULL;
+ALTER TABLE `icinga_services` MODIFY COLUMN `display_name` varchar(255) NOT NULL;
+
+
diff --git a/module/idoutils/db/mysql/mysql.sql b/module/idoutils/db/mysql/mysql.sql
index f40befd..0e55444 100644
--- a/module/idoutils/db/mysql/mysql.sql
+++ b/module/idoutils/db/mysql/mysql.sql
@@ -625,7 +625,7 @@ CREATE TABLE IF NOT EXISTS `icinga_hosts` (
   `config_type` smallint(6) NOT NULL default '0',
   `host_object_id` int(11) NOT NULL default '0',
   `alias` varchar(64) character set latin1 NOT NULL default '',
-  `display_name` varchar(64) character set latin1 collate latin1_general_cs NOT NULL default '',
+  `display_name` varchar(255) character set latin1 collate latin1_general_cs NOT NULL default '',
   `address` varchar(128) character set latin1 NOT NULL default '',
   `check_command_object_id` int(11) NOT NULL default '0',
   `check_command_args` varchar(255) character set latin1 NOT NULL default '',
@@ -1110,7 +1110,7 @@ CREATE TABLE IF NOT EXISTS `icinga_services` (
   `config_type` smallint(6) NOT NULL default '0',
   `host_object_id` int(11) NOT NULL default '0',
   `service_object_id` int(11) NOT NULL default '0',
-  `display_name` varchar(64) character set latin1 collate latin1_general_cs NOT NULL default '',
+  `display_name` varchar(255) character set latin1 collate latin1_general_cs NOT NULL default '',
   `check_command_object_id` int(11) NOT NULL default '0',
   `check_command_args` varchar(255) character set latin1 NOT NULL default '',
   `eventhandler_command_object_id` int(11) NOT NULL default '0',
diff --git a/module/idoutils/db/oracle/oracle-upgrade-1.0.3.sql b/module/idoutils/db/oracle/oracle-upgrade-1.0.3.sql
new file mode 100644
index 0000000..638f86a
--- /dev/null
+++ b/module/idoutils/db/oracle/oracle-upgrade-1.0.3.sql
@@ -0,0 +1,19 @@
+-- --------------------------------------------------------
+-- oracle-upgrade-1.0.3.sql
+-- DB definition for Oracle
+--
+-- set display_name to varchar2(255)
+--
+-- copy to $ORACLE_HOME
+-- # sqlplus username/password
+-- SQL> @oracle-upgrade-1.0.3.sql
+--
+-- current version: 2010-07-27 Michael Friedrich <michael.friedrich(at)univie.ac.at>
+--
+-- --------------------------------------------------------
+
+-- --------------------------------------------------------
+-- display_name upgrades
+-- --------------------------------------------------------
+
+ALTER TABLE services MODIFY display_name varchar2(255);
diff --git a/module/idoutils/db/oracle/oracle.sql b/module/idoutils/db/oracle/oracle.sql
index 288af52..9499102 100644
--- a/module/idoutils/db/oracle/oracle.sql
+++ b/module/idoutils/db/oracle/oracle.sql
@@ -1,7 +1,7 @@
 -- --------------------------------------------------------
 -- oracle.sql
 -- DB definition for Oracle
--- 
+--
 -- Copyright (c) 2009-2010 Icinga Development Team (http://www.icinga.org)
 --
 -- requires ocilib, oracle (instantclient) libs+sdk to work
@@ -12,12 +12,12 @@
 --
 -- enable ocilib in Icinga with
 -- ./configure --enable-idoutils --enable--oracle
--- 
--- copy to $ORACLE_HOME 
+--
+-- copy to $ORACLE_HOME
 -- # sqlplus username/password
 -- SQL> @oracle.sql
 --
--- Hints: 
+-- Hints:
 -- * set open_cursors to an appropriate value, not the default 50
 --   http://www.orafaq.com/node/758
 -- * if you are going into performance issues, consider setting commit_write to nowait
@@ -28,7 +28,7 @@
 --
 --
 -- initial version: 2008-02-20 David Schmidt
--- current version: 2010-02-10 Michael Friedrich <michael.friedrich(at)univie.ac.at>
+-- current version: 2010-07-26 Michael Friedrich <michael.friedrich(at)univie.ac.at>
 --
 -- -- --------------------------------------------------------
 
@@ -74,7 +74,7 @@ CREATE OR REPLACE PROCEDURE clean_table_by_instance
 BEGIN
 	v_stmt_str := 'DELETE FROM '
 	|| p_table_name
-	|| ' WHERE instance_id=' 
+	|| ' WHERE instance_id='
 	|| p_id;
 	EXECUTE IMMEDIATE v_stmt_str;
 END;
@@ -107,9 +107,9 @@ END;
 -- --------------------------------------------------------
 
 
--- 
+--
 -- Table structure for table acknowledgements
--- 
+--
 
 CREATE TABLE acknowledgements (
   id number(11) NOT NULL,
@@ -1224,7 +1224,7 @@ CREATE TABLE services (
   config_type number(6) default 0 NOT NULL,
   host_object_id number(11) default 0 NOT NULL,
   service_object_id number(11) default 0 NOT NULL,
-  display_name varchar2(64),
+  display_name varchar2(255),
   check_command_object_id number(11) default 0 NOT NULL,
   check_command_args varchar2(255),
   eventhandler_command_object_id number(11) default 0 NOT NULL,





More information about the icinga-checkins mailing list