From 64f01ade04863dbe7b392ea8f0fc4dcc8e32bd94 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 13 Jun 2008 00:21:53 +0000 Subject: Update svn properties, clean up formatting, refactor out duplicate hard-coded port numbers. --- OpenSim/Data/Migration.cs | 23 ++++++++++++++++------- OpenSim/Data/MySQL/MySQLInventoryData.cs | 2 +- OpenSim/Data/MySQL/MySQLUserData.cs | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/Migration.cs b/OpenSim/Data/Migration.cs index 54d4970..d23200c 100644 --- a/OpenSim/Data/Migration.cs +++ b/OpenSim/Data/Migration.cs @@ -129,9 +129,12 @@ namespace OpenSim.Data cmd.CommandText = kvp.Value; cmd.ExecuteNonQuery(); - if (version == 0) { + if (version == 0) + { InsertVersion(_type, newversion); - } else { + } + else + { UpdateVersion(_type, newversion); } version = newversion; @@ -149,7 +152,7 @@ namespace OpenSim.Data if (m.Success) { int MigrationVersion = int.Parse(m.Groups[1].ToString()); - if ( MigrationVersion > max ) + if (MigrationVersion > max) max = MigrationVersion; } } @@ -160,9 +163,12 @@ namespace OpenSim.Data { get { return FindVersion(_type); } set { - if (Version < 1) { + if (Version < 1) + { InsertVersion(_type, value); - } else { + } + else + { UpdateVersion(_type, value); } } @@ -172,7 +178,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()) { @@ -182,7 +189,9 @@ namespace OpenSim.Data } reader.Close(); } - } catch { + } + catch + { // Something went wrong, so we're version 0 } return version; diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 780b96f..de0826f 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs @@ -132,7 +132,7 @@ namespace OpenSim.Data.MySQL // if there are no tables, get out of here and let // migrations do their job - if( + if ( tableList["inventoryfolders"] == null && tableList["inventoryitems"] == null ) diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 279ff71..05874f8 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -138,7 +138,7 @@ namespace OpenSim.Data.MySQL // if there are no tables, get out of here and let // migrations do their job - if( + if ( tableList[m_agentsTableName] == null && tableList[m_usersTableName] == null && tableList[m_userFriendsTableName] == null && -- cgit v1.1