aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/Migration.cs
diff options
context:
space:
mode:
authoronefang2019-05-19 21:24:15 +1000
committeronefang2019-05-19 21:24:15 +1000
commit5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch)
treea9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Data/Migration.cs
parentAdd a build script. (diff)
downloadopensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2
opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Data/Migration.cs')
-rw-r--r--OpenSim/Data/Migration.cs26
1 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs
index d606470..e54bf55 100644
--- a/OpenSim/Data/Migration.cs
+++ b/OpenSim/Data/Migration.cs
@@ -80,10 +80,10 @@ namespace OpenSim.Data
80 80
81 /// <summary>Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint. 81 /// <summary>Have the parameterless constructor just so we can specify it as a generic parameter with the new() constraint.
82 /// Currently this is only used in the tests. A Migration instance created this way must be then 82 /// Currently this is only used in the tests. A Migration instance created this way must be then
83 /// initialized with Initialize(). Regular creation should be through the parameterized constructors. 83 /// initialized with Initialize(). Regular creation should be through the parameterized constructors.
84 /// </summary> 84 /// </summary>
85 public Migration() 85 public Migration()
86 { 86 {
87 } 87 }
88 88
89 public Migration(DbConnection conn, Assembly assem, string subtype, string type) 89 public Migration(DbConnection conn, Assembly assem, string subtype, string type)
@@ -91,7 +91,7 @@ namespace OpenSim.Data
91 Initialize(conn, assem, type, subtype); 91 Initialize(conn, assem, type, subtype);
92 } 92 }
93 93
94 public Migration(DbConnection conn, Assembly assem, string type) 94 public Migration(DbConnection conn, Assembly assem, string type)
95 { 95 {
96 Initialize(conn, assem, type, ""); 96 Initialize(conn, assem, type, "");
97 } 97 }
@@ -191,7 +191,7 @@ namespace OpenSim.Data
191 int newversion = kvp.Key; 191 int newversion = kvp.Key;
192 // we need to up the command timeout to infinite as we might be doing long migrations. 192 // we need to up the command timeout to infinite as we might be doing long migrations.
193 193
194 /* [AlexRa 01-May-10]: We can't always just run any SQL in a single batch (= ExecuteNonQuery()). Things like 194 /* [AlexRa 01-May-10]: We can't always just run any SQL in a single batch (= ExecuteNonQuery()). Things like
195 * stored proc definitions might have to be sent to the server each in a separate batch. 195 * stored proc definitions might have to be sent to the server each in a separate batch.
196 * This is certainly so for MS SQL; not sure how the MySQL connector sorts out the mess 196 * This is certainly so for MS SQL; not sure how the MySQL connector sorts out the mess
197 * with 'delimiter @@'/'delimiter ;' around procs. So each "script" this code executes now is not 197 * with 'delimiter @@'/'delimiter ;' around procs. So each "script" this code executes now is not
@@ -276,7 +276,7 @@ namespace OpenSim.Data
276 private delegate void FlushProc(); 276 private delegate void FlushProc();
277 277
278 /// <summary>Scans for migration resources in either old-style "scattered" (one file per version) 278 /// <summary>Scans for migration resources in either old-style "scattered" (one file per version)
279 /// or new-style "integrated" format (single file with ":VERSION nnn" sections). 279 /// or new-style "integrated" format (single file with ":VERSION nnn" sections).
280 /// In the new-style migrations it also recognizes ':GO' separators for parts of the SQL script 280 /// In the new-style migrations it also recognizes ':GO' separators for parts of the SQL script
281 /// that must be sent to the server separately. The old-style migrations are loaded each in one piece 281 /// that must be sent to the server separately. The old-style migrations are loaded each in one piece
282 /// and don't support the ':GO' feature. 282 /// and don't support the ':GO' feature.
@@ -301,12 +301,12 @@ namespace OpenSim.Data
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
304 * the file without looking inside if we have a higher version already. Without the suffix we read 304 * the file without looking inside if we have a higher version already. Without the suffix we read
305 * the file anyway and use the version numbers inside. Any unrecognized suffix (such as '.sql') 305 * the file anyway and use the version numbers inside. Any unrecognized suffix (such as '.sql')
306 * is valid but ignored. 306 * is valid but ignored.
307 * 307 *
308 * NOTE that we expect only one 'merged' migration file. If there are several, we take the last one. 308 * NOTE that we expect only one 'merged' migration file. If there are several, we take the last one.
309 * If you are numbering them, leave only the latest one in the project or at least make sure they numbered 309 * If you are numbering them, leave only the latest one in the project or at least make sure they numbered
310 * to come up in the correct order (e.g. 'SomeStore.migrations.001' rather than 'SomeStore.migrations.1') 310 * to come up in the correct order (e.g. 'SomeStore.migrations.001' rather than 'SomeStore.migrations.1')
311 */ 311 */
312 312
@@ -351,7 +351,7 @@ namespace OpenSim.Data
351 if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase)) 351 if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase))
352 { 352 {
353 if (sb.Length == 0) continue; 353 if (sb.Length == 0) continue;
354 if (nVersion > after) 354 if (nVersion > after)
355 script.Add(sb.ToString()); 355 script.Add(sb.ToString());
356 sb.Length = 0; 356 sb.Length = 0;
357 continue; 357 continue;
@@ -405,10 +405,10 @@ scan_old_style:
405 } 405 }
406 } 406 }
407 } 407 }
408 408
409 if (migrations.Count < 1) 409 if (migrations.Count < 1)
410 m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after); 410 m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after);
411 411
412 return migrations; 412 return migrations;
413 } 413 }
414 } 414 }