diff m-toolbox/classes/+utils/@mysql/getRepositoryVersion.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/+utils/@mysql/getRepositoryVersion.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,31 @@
+% getRepositoryVersion tries to get the version of the repository by
+% inspecting various fields in the database.
+% 
+% ver = utils.mysql.getRepositoryVersion(conn)
+% 
+% Rules:
+%       objs table contains field 'uuid' => ver = 2.1
+% 
+% else: ver = 2.0;
+% 
+% M Hewitson 11-08-09
+% 
+% $Id: getRepositoryVersion.m,v 1.3 2010/01/22 12:46:08 ingo Exp $
+% 
+
+function ver = getRepositoryVersion(conn)
+  
+  error('### Obsolete as of LTPDA version 2.2. Replaced my the utils class jmysql (utils.jmysql.%s)', mfilename());
+  ver = '2.0';
+  
+  q    = ['describe ' conn.Instance '.objs'];
+  curs = exec(conn, q);
+  curs = fetch(curs);
+  
+  if utils.helper.ismember('uuid', curs.Data(:,1))
+    ver = '2.1';
+  end
+  
+  
+end
+