From 13a4d13d670974e7108ccce98a335ad634d77f65 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 9 Mar 2008 14:27:44 +0000 Subject: * Added a hack-ish routine to add the State column to the primshapes table if it wasn't already there. * Started OpenSim on SQLite to a mass of red 'unable to load prim' messages. * If you are getting this message, after this update, when you start OpenSimulator, you'll get it one more time and then it'll work again. --- OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs index d41dd55..b724337 100644 --- a/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs +++ b/OpenSim/Framework/Data.SQLite/SQLiteRegionData.cs @@ -1171,7 +1171,17 @@ namespace OpenSim.Framework.Data.SQLite s.ProfileEnd = Convert.ToUInt16(row["ProfileEnd"]); s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); - s.State = Convert.ToByte(row["State"]); + try + { + s.State = Convert.ToByte(row["State"]); + } + catch (InvalidCastException) + { + m_conn.Open(); + SqliteCommand cmd = + new SqliteCommand("ALTER TABLE primshapes ADD COLUMN State Integer NOT NULL default 0;", m_conn); + cmd.ExecuteNonQuery(); + } // text TODO: this isn't right] = but I'm not sure the right // way to specify this as a blob atm -- cgit v1.1