From 3e5fcf90aa034a9ae59dc7a7ac2ace793e60d4ae Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 22 Oct 2007 22:15:38 +0000 Subject: * Table creation now checks if the table already exists before building it. --- .../MonoSqliteDataStore.cs | 30 +++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index e5b9cc0..e2614ee 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -860,9 +860,33 @@ namespace OpenSim.DataStore.MonoSqlite SqliteCommand scmd = new SqliteCommand(createShapes, conn); SqliteCommand tcmd = new SqliteCommand(createTerrain, conn); conn.Open(); - pcmd.ExecuteNonQuery(); - scmd.ExecuteNonQuery(); - tcmd.ExecuteNonQuery(); + + try + { + pcmd.ExecuteNonQuery(); + } + catch (SqliteSyntaxException) { + MainLog.Instance.Warn("SQLITE","Primitives Table Already Exists"); + } + + try + { + scmd.ExecuteNonQuery(); + } + catch (SqliteSyntaxException) + { + MainLog.Instance.Warn("SQLITE", "Shapes Table Already Exists"); + } + + try + { + tcmd.ExecuteNonQuery(); + } + catch (SqliteSyntaxException) + { + MainLog.Instance.Warn("SQLITE", "Terrain Table Already Exists"); + } + conn.Close(); } -- cgit v1.1