From 5910a49da6e16d6e3718fffad73c8a24efcec80d Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 10 Jun 2008 08:35:46 +0000 Subject: Update svn properties. Formatting cleanup. --- OpenSim/Data/Migration.cs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'OpenSim/Data/Migration.cs') 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 } newversion = MaxVersion(); - if (newversion > version) { - if (version == 0) { + if (newversion > version) + { + if (version == 0) + { InsertVersion(_type, newversion); - } else { + } + else + { UpdateVersion(_type, newversion); } } @@ -144,7 +148,7 @@ namespace OpenSim.Data if (m.Success) { int MigrationVersion = int.Parse(m.Groups[1].ToString()); - if ( MigrationVersion > max ) + if (MigrationVersion > max) max = MigrationVersion; } } @@ -155,7 +159,8 @@ namespace OpenSim.Data { int version = 0; DbCommand cmd = _conn.CreateCommand(); - try { + try + { cmd.CommandText = "select version from migrations where name='" + type + "' limit 1"; using (IDataReader reader = cmd.ExecuteReader()) { @@ -165,7 +170,9 @@ namespace OpenSim.Data } reader.Close(); } - } catch { + } + catch + { // Something went wrong, so we're version 0 } return version; @@ -218,10 +225,11 @@ namespace OpenSim.Data } // TODO: once this is working, get rid of this - if (migrations.Count < 1) { + if (migrations.Count < 1) + { m_log.InfoFormat("Resource '{0}' was not found", _type); } return migrations; } } -} \ No newline at end of file +} -- cgit v1.1