aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Migration.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 {