aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Migration.cs
diff options
context:
space:
mode:
authorMelanie2010-09-13 16:16:40 +0100
committerMelanie2010-09-13 16:17:38 +0100
commit6a1ce17cdbf143f11262e1194b6a6d9e5bb1077e (patch)
tree1e7bf4fddcf559886c6b2babf13cf4b2ca8829a1 /OpenSim/Data/Migration.cs
parentMerge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/va... (diff)
parentFix unit test SceneSetupHelpers to load the mock simulation data store (diff)
downloadopensim-SC-6a1ce17cdbf143f11262e1194b6a6d9e5bb1077e.zip
opensim-SC-6a1ce17cdbf143f11262e1194b6a6d9e5bb1077e.tar.gz
opensim-SC-6a1ce17cdbf143f11262e1194b6a6d9e5bb1077e.tar.bz2
opensim-SC-6a1ce17cdbf143f11262e1194b6a6d9e5bb1077e.tar.xz
Merge branch 'master' into careminster-presence-refactor
The modules will need to be updated for this to compile and run again. Please don't use until I do the companion commit to modules later on.
Diffstat (limited to 'OpenSim/Data/Migration.cs')
-rw-r--r--OpenSim/Data/Migration.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs
index 86531d9..fc9a142 100644
--- a/OpenSim/Data/Migration.cs
+++ b/OpenSim/Data/Migration.cs
@@ -122,7 +122,7 @@ namespace OpenSim.Data
122 int ver = FindVersion(_conn, "migrations"); 122 int ver = FindVersion(_conn, "migrations");
123 if (ver <= 0) // -1 = no table, 0 = no version record 123 if (ver <= 0) // -1 = no table, 0 = no version record
124 { 124 {
125 if( ver < 0 ) 125 if (ver < 0)
126 ExecuteScript("create table migrations(name varchar(100), version int)"); 126 ExecuteScript("create table migrations(name varchar(100), version int)");
127 InsertVersion("migrations", 1); 127 InsertVersion("migrations", 1);
128 } 128 }
@@ -288,7 +288,7 @@ namespace OpenSim.Data
288 SortedList<int, string[]> migrations = new SortedList<int, string[]>(); 288 SortedList<int, string[]> migrations = new SortedList<int, string[]>();
289 289
290 string[] names = _assem.GetManifestResourceNames(); 290 string[] names = _assem.GetManifestResourceNames();
291 if( names.Length == 0 ) // should never happen 291 if (names.Length == 0) // should never happen
292 return migrations; 292 return migrations;
293 293
294 Array.Sort(names); // we want all the migrations ordered 294 Array.Sort(names); // we want all the migrations ordered
@@ -297,7 +297,7 @@ namespace OpenSim.Data
297 Match m = null; 297 Match m = null;
298 string sFile = Array.FindLast(names, nm => { m = _match_new.Match(nm); return m.Success; }); // ; nm.StartsWith(sPrefix, StringComparison.InvariantCultureIgnoreCase 298 string sFile = Array.FindLast(names, nm => { m = _match_new.Match(nm); return m.Success; }); // ; nm.StartsWith(sPrefix, StringComparison.InvariantCultureIgnoreCase
299 299
300 if( (m != null) && !String.IsNullOrEmpty(sFile) ) 300 if ((m != null) && !String.IsNullOrEmpty(sFile))
301 { 301 {
302 /* The filename should be '<StoreName>.migrations[.NNN]' where NNN 302 /* The filename should be '<StoreName>.migrations[.NNN]' where NNN
303 * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip 303 * is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip
@@ -312,7 +312,7 @@ namespace OpenSim.Data
312 312
313 if (m.Groups.Count > 1 && int.TryParse(m.Groups[1].Value, out nLastVerFound)) 313 if (m.Groups.Count > 1 && int.TryParse(m.Groups[1].Value, out nLastVerFound))
314 { 314 {
315 if( nLastVerFound <= after ) 315 if (nLastVerFound <= after)
316 goto scan_old_style; 316 goto scan_old_style;
317 } 317 }
318 318
@@ -329,7 +329,7 @@ namespace OpenSim.Data
329 sb.Length = 0; 329 sb.Length = 0;
330 } 330 }
331 331
332 if ( (nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list 332 if ((nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list
333 { 333 {
334 migrations[nVersion] = script.ToArray(); 334 migrations[nVersion] = script.ToArray();
335 } 335 }
@@ -345,7 +345,7 @@ namespace OpenSim.Data
345 string sLine = resourceReader.ReadLine(); 345 string sLine = resourceReader.ReadLine();
346 nLineNo++; 346 nLineNo++;
347 347
348 if( String.IsNullOrEmpty(sLine) || sLine.StartsWith("#") ) // ignore a comment or empty line 348 if (String.IsNullOrEmpty(sLine) || sLine.StartsWith("#")) // ignore a comment or empty line
349 continue; 349 continue;
350 350
351 if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase)) 351 if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase))
@@ -392,7 +392,7 @@ scan_old_style:
392 if (m.Success) 392 if (m.Success)
393 { 393 {
394 int version = int.Parse(m.Groups[1].ToString()); 394 int version = int.Parse(m.Groups[1].ToString());
395 if ( (version > after) && !migrations.ContainsKey(version) ) 395 if ((version > after) && !migrations.ContainsKey(version))
396 { 396 {
397 using (Stream resource = _assem.GetManifestResourceStream(s)) 397 using (Stream resource = _assem.GetManifestResourceStream(s))
398 { 398 {