Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@jmysql/getRepositoryVersion.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % getRepositoryVersion tries to get the version of the repository by | |
2 % inspecting various fields in the database. | |
3 % | |
4 % ver = utils.jmysql.getRepositoryVersion(conn) | |
5 % | |
6 % Rules: | |
7 % objs table contains field 'uuid' => ver = 2.1 | |
8 % | |
9 % else: ver = 2.0; | |
10 % | |
11 % M Hewitson 11-08-09 | |
12 % | |
13 % $Id: getRepositoryVersion.m,v 1.2 2009/08/11 12:33:19 ingo Exp $ | |
14 % | |
15 | |
16 function ver = getRepositoryVersion(conn) | |
17 | |
18 ver = '2.0'; | |
19 | |
20 q = ['describe ' char(conn.getDatabase) '.objs']; | |
21 results = conn.query(q); | |
22 fields = {}; | |
23 while results.next | |
24 fields = [fields {char(results.getString(1))}]; | |
25 end | |
26 | |
27 if utils.helper.ismember('uuid', fields) | |
28 ver = '2.1'; | |
29 end | |
30 | |
31 | |
32 end | |
33 |