diff options
author | Jeff Ames | 2008-06-10 08:35:46 +0000 |
---|---|---|
committer | Jeff Ames | 2008-06-10 08:35:46 +0000 |
commit | 5910a49da6e16d6e3718fffad73c8a24efcec80d (patch) | |
tree | 5f5852f643a77e72b45ad49af0538bdf0838b760 /OpenSim/Data | |
parent | * This completes ObjectDuplicateOnRay. (diff) | |
download | opensim-SC_OLD-5910a49da6e16d6e3718fffad73c8a24efcec80d.zip opensim-SC_OLD-5910a49da6e16d6e3718fffad73c8a24efcec80d.tar.gz opensim-SC_OLD-5910a49da6e16d6e3718fffad73c8a24efcec80d.tar.bz2 opensim-SC_OLD-5910a49da6e16d6e3718fffad73c8a24efcec80d.tar.xz |
Update svn properties. Formatting cleanup.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/Migration.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 0417269..75d5307 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs | |||
@@ -121,10 +121,14 @@ namespace OpenSim.Data | |||
121 | } | 121 | } |
122 | 122 | ||
123 | newversion = MaxVersion(); | 123 | newversion = MaxVersion(); |
124 | if (newversion > version) { | 124 | if (newversion > version) |
125 | if (version == 0) { | 125 | { |
126 | if (version == 0) | ||
127 | { | ||
126 | InsertVersion(_type, newversion); | 128 | InsertVersion(_type, newversion); |
127 | } else { | 129 | } |
130 | else | ||
131 | { | ||
128 | UpdateVersion(_type, newversion); | 132 | UpdateVersion(_type, newversion); |
129 | } | 133 | } |
130 | } | 134 | } |
@@ -144,7 +148,7 @@ namespace OpenSim.Data | |||
144 | if (m.Success) | 148 | if (m.Success) |
145 | { | 149 | { |
146 | int MigrationVersion = int.Parse(m.Groups[1].ToString()); | 150 | int MigrationVersion = int.Parse(m.Groups[1].ToString()); |
147 | if ( MigrationVersion > max ) | 151 | if (MigrationVersion > max) |
148 | max = MigrationVersion; | 152 | max = MigrationVersion; |
149 | } | 153 | } |
150 | } | 154 | } |
@@ -155,7 +159,8 @@ namespace OpenSim.Data | |||
155 | { | 159 | { |
156 | int version = 0; | 160 | int version = 0; |
157 | DbCommand cmd = _conn.CreateCommand(); | 161 | DbCommand cmd = _conn.CreateCommand(); |
158 | try { | 162 | try |
163 | { | ||
159 | cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; | 164 | cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; |
160 | using (IDataReader reader = cmd.ExecuteReader()) | 165 | using (IDataReader reader = cmd.ExecuteReader()) |
161 | { | 166 | { |
@@ -165,7 +170,9 @@ namespace OpenSim.Data | |||
165 | } | 170 | } |
166 | reader.Close(); | 171 | reader.Close(); |
167 | } | 172 | } |
168 | } catch { | 173 | } |
174 | catch | ||
175 | { | ||
169 | // Something went wrong, so we're version 0 | 176 | // Something went wrong, so we're version 0 |
170 | } | 177 | } |
171 | return version; | 178 | return version; |
@@ -218,10 +225,11 @@ namespace OpenSim.Data | |||
218 | } | 225 | } |
219 | 226 | ||
220 | // TODO: once this is working, get rid of this | 227 | // TODO: once this is working, get rid of this |
221 | if (migrations.Count < 1) { | 228 | if (migrations.Count < 1) |
229 | { | ||
222 | m_log.InfoFormat("Resource '{0}' was not found", _type); | 230 | m_log.InfoFormat("Resource '{0}' was not found", _type); |
223 | } | 231 | } |
224 | return migrations; | 232 | return migrations; |
225 | } | 233 | } |
226 | } | 234 | } |
227 | } \ No newline at end of file | 235 | } |