diff options
Diffstat (limited to 'OpenSim/Data/Migration.cs')
-rw-r--r-- | OpenSim/Data/Migration.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index ecd18ae..8e4cba3 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs | |||
@@ -103,7 +103,7 @@ namespace OpenSim.Data | |||
103 | private void Initialize() | 103 | private void Initialize() |
104 | { | 104 | { |
105 | // clever, eh, we figure out which migrations version we are | 105 | // clever, eh, we figure out which migrations version we are |
106 | int migration_version = FindVersion("migrations"); | 106 | int migration_version = FindVersion(_conn, "migrations"); |
107 | 107 | ||
108 | if (migration_version > 0) | 108 | if (migration_version > 0) |
109 | return; | 109 | return; |
@@ -119,7 +119,7 @@ namespace OpenSim.Data | |||
119 | public void Update() | 119 | public void Update() |
120 | { | 120 | { |
121 | int version = 0; | 121 | int version = 0; |
122 | version = FindVersion(_type); | 122 | version = FindVersion(_conn, _type); |
123 | 123 | ||
124 | SortedList<int, string> migrations = GetMigrationsAfter(version); | 124 | SortedList<int, string> migrations = GetMigrationsAfter(version); |
125 | if (migrations.Count < 1) | 125 | if (migrations.Count < 1) |
@@ -170,7 +170,7 @@ namespace OpenSim.Data | |||
170 | 170 | ||
171 | public int Version | 171 | public int Version |
172 | { | 172 | { |
173 | get { return FindVersion(_type); } | 173 | get { return FindVersion(_conn, _type); } |
174 | set { | 174 | set { |
175 | if (Version < 1) | 175 | if (Version < 1) |
176 | { | 176 | { |
@@ -183,10 +183,10 @@ namespace OpenSim.Data | |||
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | private int FindVersion(string type) | 186 | protected virtual int FindVersion(DbConnection conn, string type) |
187 | { | 187 | { |
188 | int version = 0; | 188 | int version = 0; |
189 | DbCommand cmd = _conn.CreateCommand(); | 189 | DbCommand cmd = conn.CreateCommand(); |
190 | try | 190 | try |
191 | { | 191 | { |
192 | cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; | 192 | cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; |