diff options
author | Melanie Thielker | 2008-09-01 17:10:01 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-01 17:10:01 +0000 |
commit | b6bb5f944f19b330656105ff79cd5ca3f2d5c242 (patch) | |
tree | 433ee8a24136ac10ed63dc3cf715b16ba786b8a8 /OpenSim/Data/MSSQL/MSSQLMigration.cs | |
parent | Mantis #2072 (diff) | |
download | opensim-SC-b6bb5f944f19b330656105ff79cd5ca3f2d5c242.zip opensim-SC-b6bb5f944f19b330656105ff79cd5ca3f2d5c242.tar.gz opensim-SC-b6bb5f944f19b330656105ff79cd5ca3f2d5c242.tar.bz2 opensim-SC-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.cs | 45 |
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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Data; | ||
4 | using System.Data.Common; | ||
5 | using System.Reflection; | ||
6 | using System.Text; | ||
7 | |||
8 | namespace 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 | } | ||