diff options
author | Melanie | 2011-06-09 02:05:04 +0100 |
---|---|---|
committer | Melanie | 2011-06-09 02:05:04 +0100 |
commit | 326c46ba70cea70ddfe4aef9a6b73edff63e126a (patch) | |
tree | 5e76347b0d77f58717d8e5e4f3b8787ff01a18d7 /OpenSim/Data/MSSQL/MSSQLMigration.cs | |
parent | Make the last otem in a list created with llCSV2List findable (diff) | |
parent | Consistency fix on the last commit. (diff) | |
download | opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.zip opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.gz opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.bz2 opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.xz |
Merge branch 'master' into careminster-presence-refactor
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 | } |