aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLMigration.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-09-01 17:10:01 +0000
committerMelanie Thielker2008-09-01 17:10:01 +0000
commitb6bb5f944f19b330656105ff79cd5ca3f2d5c242 (patch)
tree433ee8a24136ac10ed63dc3cf715b16ba786b8a8 /OpenSim/Data/MSSQL/MSSQLMigration.cs
parentMantis #2072 (diff)
downloadopensim-SC_OLD-b6bb5f944f19b330656105ff79cd5ca3f2d5c242.zip
opensim-SC_OLD-b6bb5f944f19b330656105ff79cd5ca3f2d5c242.tar.gz
opensim-SC_OLD-b6bb5f944f19b330656105ff79cd5ca3f2d5c242.tar.bz2
opensim-SC_OLD-b6bb5f944f19b330656105ff79cd5ca3f2d5c242.tar.xz
Mantis #2095
Thank you, RuudL, for a complete adaptation of migration and estate data to MSSQL, and the updating of the RegionData handling in MSSQL.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLMigration.cs45
1 files changed, 45 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLMigration.cs b/OpenSim/Data/MSSQL/MSSQLMigration.cs
new file mode 100644
index 0000000..67fc606
--- /dev/null
+++ b/OpenSim/Data/MSSQL/MSSQLMigration.cs
@@ -0,0 +1,45 @@
1using System;
2using System.Collections.Generic;
3using System.Data;
4using System.Data.Common;
5using System.Reflection;
6using System.Text;
7
8namespace OpenSim.Data.MSSQL
9{
10 public class MSSQLMigration : Migration
11 {
12 public MSSQLMigration(DbConnection conn, Assembly assem, string type) : base(conn, assem, type)
13 {
14 }
15
16 public MSSQLMigration(DbConnection conn, Assembly assem, string subtype, string type) : base(conn, assem, subtype, type)
17 {
18 }
19
20 protected override int FindVersion(DbConnection conn, string type)
21 {
22 int version = 0;
23 using (DbCommand cmd = conn.CreateCommand())
24 {
25 try
26 {
27 cmd.CommandText = "select top 1 version from migrations where name = '" + type + "' order by version desc"; //Must be
28 using (IDataReader reader = cmd.ExecuteReader())
29 {
30 if (reader.Read())
31 {
32 version = Convert.ToInt32(reader["version"]);
33 }
34 reader.Close();
35 }
36 }
37 catch
38 {
39 // Something went wrong, so we're version 0
40 }
41 }
42 return version;
43 }
44 }
45}