diff options
author | Chris Hart | 2011-06-01 04:01:18 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-06-01 21:01:04 +0100 |
commit | 5fb0455e929d96efb41d23f67653b329792ab834 (patch) | |
tree | b28593f324ba685cd3c4d23036438a4890bb7bb8 /OpenSim/Data/MSSQL/MSSQLMigration.cs | |
parent | a few minor formatting tweaks (diff) | |
download | opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.zip opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.tar.gz opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.tar.bz2 opensim-SC_OLD-5fb0455e929d96efb41d23f67653b329792ab834.tar.xz |
Updates to MSSQL to most recent compatibility, also included Windlight support. Needs plenty of testing but clean install and migration from 0.6.9 have been tested and work, a few indexes still need to be added for performance.
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLMigration.cs')
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLMigration.cs | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLMigration.cs b/OpenSim/Data/MSSQL/MSSQLMigration.cs index cd395b8..1aa96c7 100644 --- a/OpenSim/Data/MSSQL/MSSQLMigration.cs +++ b/OpenSim/Data/MSSQL/MSSQLMigration.cs | |||
@@ -29,16 +29,19 @@ using System; | |||
29 | using System.Data; | 29 | using System.Data; |
30 | using System.Data.Common; | 30 | using System.Data.Common; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Data.SqlClient; | ||
32 | 33 | ||
33 | namespace OpenSim.Data.MSSQL | 34 | namespace OpenSim.Data.MSSQL |
34 | { | 35 | { |
35 | public class MSSQLMigration : Migration | 36 | public class MSSQLMigration : Migration |
36 | { | 37 | { |
37 | public MSSQLMigration(DbConnection conn, Assembly assem, string type) : base(conn, assem, type) | 38 | public MSSQLMigration(DbConnection conn, Assembly assem, string type) |
39 | : base(conn, assem, type) | ||
38 | { | 40 | { |
39 | } | 41 | } |
40 | 42 | ||
41 | public MSSQLMigration(DbConnection conn, Assembly assem, string subtype, string type) : base(conn, assem, subtype, type) | 43 | public MSSQLMigration(DbConnection conn, Assembly assem, string subtype, string type) |
44 | : base(conn, assem, subtype, type) | ||
42 | { | 45 | { |
43 | } | 46 | } |
44 | 47 | ||
@@ -67,5 +70,30 @@ namespace OpenSim.Data.MSSQL | |||
67 | } | 70 | } |
68 | return version; | 71 | return version; |
69 | } | 72 | } |
73 | |||
74 | protected override void ExecuteScript(DbConnection conn, string[] script) | ||
75 | { | ||
76 | if (!(conn is SqlConnection)) | ||
77 | { | ||
78 | base.ExecuteScript(conn, script); | ||
79 | return; | ||
80 | } | ||
81 | |||
82 | foreach (string sql in script) | ||
83 | { | ||
84 | try | ||
85 | { | ||
86 | using (SqlCommand cmd = new SqlCommand(sql, (SqlConnection)conn)) | ||
87 | { | ||
88 | cmd.ExecuteNonQuery(); | ||
89 | } | ||
90 | } | ||
91 | catch (Exception ex) | ||
92 | { | ||
93 | throw new Exception(sql); | ||
94 | |||
95 | } | ||
96 | } | ||
97 | } | ||
70 | } | 98 | } |
71 | } | 99 | } |