[tango] 02/08: update the upgrade script

Frédéric-Emmanuel Picca picca at moszumanska.debian.org
Mon Feb 29 08:05:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

picca pushed a commit to branch master
in repository tango.

commit 9b99f315be2f27845c7c98569a06a77066884279
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date:   Sat Feb 27 16:07:15 2016 +0100

    update the upgrade script
---
 debian/mysql/9.1.0 | 194 +++++++++++++++++++++++++++++++----------------------
 1 file changed, 115 insertions(+), 79 deletions(-)

diff --git a/debian/mysql/9.1.0 b/debian/mysql/9.1.0
index a5c7985..f9b25b3 100644
--- a/debian/mysql/9.1.0
+++ b/debian/mysql/9.1.0
@@ -1,3 +1,109 @@
+USE tango;
+
+#
+# Update all history ids to 0
+#
+
+UPDATE class_attribute_history_id SET id=0;
+UPDATE class_history_id SET id=0;
+UPDATE class_pipe_history_id SET id=0;
+UPDATE device_attribute_history_id SET id=0;
+UPDATE device_history_id SET id=0;
+UPDATE device_pipe_history_id SET id=0;
+UPDATE object_history_id SET id=0;
+
+#
+# Clean up history tables
+#
+
+DELETE FROM property_attribute_class_hist;
+DELETE FROM property_attribute_device_hist;
+DELETE FROM property_class_hist;
+DELETE FROM property_device_hist;
+DELETE FROM property_hist;
+DELETE FROM property_pipe_class_hist;
+DELETE FROM property_pipe_device_hist;
+
+#
+# Table structure for table 'property_pipe_class'
+#
+
+CREATE TABLE IF NOT EXISTS property_pipe_class (
+  class varchar(255) NOT NULL default '',
+  pipe varchar(255) NOT NULL default '',
+  name varchar(255) NOT NULL default '',
+  count int(11) NOT NULL default '0',
+  value text default NULL,
+  updated timestamp NOT NULL,
+  accessed timestamp NOT NULL,
+  comment text,
+  KEY index_property_pipe_class (class(64),pipe(64),name(64),count)
+) ENGINE=MyISAM;
+
+#
+# Table structure for table 'property_pipe_device'
+#
+
+CREATE TABLE IF NOT EXISTS property_pipe_device (
+  device varchar(255) NOT NULL default '',
+  pipe varchar(255) NOT NULL default '',
+  name varchar(255) NOT NULL default '',
+  count int(11) NOT NULL default '0',
+  value text default NULL,
+  updated timestamp NOT NULL,
+  accessed timestamp NOT NULL,
+  comment text,
+  KEY index_property_pipe_device (device(64),pipe(64),name(64),count)
+) ENGINE=MyISAM;
+
+#
+# For history ID
+#
+
+CREATE TABLE IF NOT EXISTS device_pipe_history_id (
+  id bigint unsigned NOT NULL default '0'
+) ENGINE=MyISAM;
+
+CREATE TABLE IF NOT EXISTS class_pipe_history_id (
+  id bigint unsigned NOT NULL default '0'
+) ENGINE=MyISAM;
+
+#
+# History tables
+#
+
+CREATE TABLE IF NOT EXISTS property_pipe_class_hist (
+  id bigint unsigned NOT NULL default '0',
+  date timestamp NOT NULL,
+  class varchar(255) NOT NULL default '',
+  pipe varchar(255) NOT NULL default '',
+  name varchar(255) NOT NULL default '',
+  count int(11) NOT NULL default '0',
+  value text,
+  KEY index_id (id),
+  KEY index_class (class),
+  KEY index_pipe (pipe),
+  KEY index_name (name)  
+) ENGINE=MyISAM;
+
+CREATE TABLE IF NOT EXISTS property_pipe_device_hist (
+  id bigint unsigned NOT NULL default '0',
+  date timestamp NOT NULL,
+  device varchar(255) NOT NULL default '',
+  pipe varchar(255) NOT NULL default '',
+  name varchar(255) NOT NULL default '',
+  count int(11) NOT NULL default '0',
+  value text,
+  KEY index_id (id),
+  KEY index_device (device),
+  KEY index_pipe (pipe),
+  KEY index_name (name)  
+) ENGINE=MyISAM;
+
+#
+# Load the new stored procedures
+#
+
 DROP PROCEDURE IF EXISTS tango.ds_start;
 DROP PROCEDURE IF EXISTS tango.import_event;
 DROP PROCEDURE IF EXISTS tango.import_device;
@@ -1154,90 +1260,12 @@ END |
 
 
 DELIMITER ;
-USE tango;
-
-#
-# Table structure for table 'property_pipe_class'
-#
-
-CREATE TABLE IF NOT EXISTS property_pipe_class (
-  class varchar(255) NOT NULL default '',
-  pipe varchar(255) NOT NULL default '',
-  name varchar(255) NOT NULL default '',
-  count int(11) NOT NULL default '0',
-  value text default NULL,
-  updated timestamp NOT NULL,
-  accessed timestamp NOT NULL,
-  comment text,
-  KEY index_property_pipe_class (class(64),pipe(64),name(64),count)
-) ENGINE=MyISAM;
-
-#
-# Table structure for table 'property_pipe_device'
-#
-
-CREATE TABLE IF NOT EXISTS property_pipe_device (
-  device varchar(255) NOT NULL default '',
-  pipe varchar(255) NOT NULL default '',
-  name varchar(255) NOT NULL default '',
-  count int(11) NOT NULL default '0',
-  value text default NULL,
-  updated timestamp NOT NULL,
-  accessed timestamp NOT NULL,
-  comment text,
-  KEY index_property_pipe_device (device(64),pipe(64),name(64),count)
-) ENGINE=MyISAM;
-
-#
-# For history ID
-#
-
-CREATE TABLE IF NOT EXISTS device_pipe_history_id (
-  id bigint unsigned NOT NULL default '0'
-) ENGINE=MyISAM;
-
-CREATE TABLE IF NOT EXISTS class_pipe_history_id (
-  id bigint unsigned NOT NULL default '0'
-) ENGINE=MyISAM;
-
-#
-# History tables
-#
-
-CREATE TABLE IF NOT EXISTS property_pipe_class_hist (
-  id bigint unsigned NOT NULL default '0',
-  date timestamp NOT NULL,
-  class varchar(255) NOT NULL default '',
-  pipe varchar(255) NOT NULL default '',
-  name varchar(255) NOT NULL default '',
-  count int(11) NOT NULL default '0',
-  value text,
-  KEY index_id (id),
-  KEY index_class (class),
-  KEY index_pipe (pipe),
-  KEY index_name (name)  
-) ENGINE=MyISAM;
-
-CREATE TABLE IF NOT EXISTS property_pipe_device_hist (
-  id bigint unsigned NOT NULL default '0',
-  date timestamp NOT NULL,
-  device varchar(255) NOT NULL default '',
-  pipe varchar(255) NOT NULL default '',
-  name varchar(255) NOT NULL default '',
-  count int(11) NOT NULL default '0',
-  value text,
-  KEY index_id (id),
-  KEY index_device (device),
-  KEY index_pipe (pipe),
-  KEY index_name (name)  
-) ENGINE=MyISAM;
 
 #
 # Init new history ID
 #
 
-INSERT INTO device_pipe_history_id VALUES (0);
-INSERT INTO class_pipe_history_id VALUES (0);
+CALL init_history_ids();
 
 #
 # Update history id columns to support id on more than 32 bits
@@ -1259,6 +1287,8 @@ ALTER TABLE object_history_id MODIFY id bigint unsigned NOT NULL default '0';
 # Update entries in the property_class tables for database
 #
 
+DELETE FROM property_class WHERE class='Database' AND count >= 35;
+
 INSERT INTO property_class VALUES('Database','AllowedAccessCmd',35,'DbGetDeviceClassList',NULL,NULL,NULL);
 INSERT INTO property_class VALUES('Database','AllowedAccessCmd',36,'DbGetDeviceExportedList',NULL,NULL,NULL);
 INSERT INTO property_class VALUES('Database','AllowedAccessCmd',37,'DbGetHostServerList',NULL,NULL,NULL);
@@ -1270,3 +1300,9 @@ INSERT INTO property_class VALUES('Database','AllowedAccessCmd',42,'DbGetClassPi
 INSERT INTO property_class VALUES('Database','AllowedAccessCmd',43,'DbGetDevicePipeList',NULL,NULL,NULL);
 INSERT INTO property_class VALUES('Database','AllowedAccessCmd',44,'DbGetAttributeAliasList',NULL,NULL,NULL);
 
+#
+# Remove history entries for the property used by memorized attribute
+#
+
+DELETE FROM property_attribute_device_hist WHERE count=1 AND name='__value';
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/tango.git



More information about the debian-science-commits mailing list