From f799678d6c086398cffb8301f6493f98ccb931be Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 7 Sep 2010 20:34:45 +0100 Subject: [PATCH] Remove estate_settings.xml migration code from MySQL driver --- OpenSim/Data/MySQL/MySQLEstateData.cs | 64 --------------------------- 1 file changed, 64 deletions(-) diff --git a/OpenSim/Data/MySQL/MySQLEstateData.cs b/OpenSim/Data/MySQL/MySQLEstateData.cs index 2eae2d82b2..a74e37a4a5 100644 --- a/OpenSim/Data/MySQL/MySQLEstateData.cs +++ b/OpenSim/Data/MySQL/MySQLEstateData.cs @@ -129,8 +129,6 @@ namespace OpenSim.Data.MySQL string sql = "select estate_settings." + String.Join(",estate_settings.", FieldList) + " from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = ?RegionID"; - bool migration = true; - using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) { dbcon.Open(); @@ -144,8 +142,6 @@ namespace OpenSim.Data.MySQL { if (r.Read()) { - migration = false; - foreach (string name in FieldList) { if (m_FieldMap[name].GetValue(es) is bool) @@ -171,66 +167,6 @@ namespace OpenSim.Data.MySQL } } } - - if (migration) - { - // Migration case - List names = new List(FieldList); - - names.Remove("EstateID"); - - sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")"; - - using (MySqlCommand cmd = dbcon.CreateCommand()) - { - cmd.CommandText = sql; - cmd.Parameters.Clear(); - - foreach (string name in FieldList) - { - if (m_FieldMap[name].GetValue(es) is bool) - { - if ((bool)m_FieldMap[name].GetValue(es)) - cmd.Parameters.AddWithValue("?" + name, "1"); - else - cmd.Parameters.AddWithValue("?" + name, "0"); - } - else - { - cmd.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString()); - } - } - - cmd.ExecuteNonQuery(); - - cmd.CommandText = "select LAST_INSERT_ID() as id"; - cmd.Parameters.Clear(); - - using (IDataReader r = cmd.ExecuteReader()) - { - r.Read(); - es.EstateID = Convert.ToUInt32(r["id"]); - } - - cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)"; - cmd.Parameters.AddWithValue("?RegionID", regionID.ToString()); - cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString()); - - // This will throw on dupe key - try { cmd.ExecuteNonQuery(); } - catch (Exception) { } - - // Munge and transfer the ban list - cmd.Parameters.Clear(); - cmd.CommandText = "insert into estateban select " + es.EstateID.ToString() + ", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = ?UUID"; - cmd.Parameters.AddWithValue("?UUID", regionID.ToString()); - - try { cmd.ExecuteNonQuery(); } - catch (Exception) { } - - es.Save(); - } - } } LoadBanList(es);