From c75f1fcde8b459382dbe32a1f130e987d0ff9a7d Mon Sep 17 00:00:00 2001
From: Sean Dague
Date: Wed, 27 Aug 2008 19:24:45 +0000
Subject: we are now past change 6000, so getting rid of pre-Migration cruft
---
OpenSim/Data/SQLite/SQLiteRegionData.cs | 222 --------------------------------
1 file changed, 222 deletions(-)
(limited to 'OpenSim/Data/SQLite')
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index a44b892..dd88751 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -118,11 +118,6 @@ namespace OpenSim.Data.SQLite
// This actually does the roll forward assembly stuff
Assembly assem = GetType().Assembly;
Migration m = new Migration(m_conn, assem, "RegionStore");
-
- // TODO: After rev 6000, remove this. People should have
- // been rolled onto the new migration code by then.
- TestTables(m_conn, m);
-
m.Update();
lock (ds)
@@ -1723,191 +1718,6 @@ namespace OpenSim.Data.SQLite
da.DeleteCommand = delete;
}
- ///
- /// Create the necessary database tables.
- ///
- ///
- // private void InitDB(SqliteConnection conn)
- // {
- // string createPrims = defineTable(createPrimTable());
- // string createShapes = defineTable(createShapeTable());
- // string createItems = defineTable(createItemsTable());
- // string createTerrain = defineTable(createTerrainTable());
- // string createLand = defineTable(createLandTable());
- // string createLandAccessList = defineTable(createLandAccessListTable());
-
- // SqliteCommand pcmd = new SqliteCommand(createPrims, conn);
- // SqliteCommand scmd = new SqliteCommand(createShapes, conn);
- // SqliteCommand icmd = new SqliteCommand(createItems, conn);
- // SqliteCommand tcmd = new SqliteCommand(createTerrain, conn);
- // SqliteCommand lcmd = new SqliteCommand(createLand, conn);
- // SqliteCommand lalcmd = new SqliteCommand(createLandAccessList, conn);
-
- // try
- // {
- // pcmd.ExecuteNonQuery();
- // }
- // catch (SqliteSyntaxException)
- // {
- // m_log.Warn("[REGION DB]: Primitives Table Already Exists");
- // }
-
- // try
- // {
- // scmd.ExecuteNonQuery();
- // }
- // catch (SqliteSyntaxException)
- // {
- // m_log.Warn("[REGION DB]: Shapes Table Already Exists");
- // }
-
- // try
- // {
- // icmd.ExecuteNonQuery();
- // }
- // catch (SqliteSyntaxException)
- // {
- // m_log.Warn("[REGION DB]: Primitives Inventory Table Already Exists");
- // }
-
- // try
- // {
- // tcmd.ExecuteNonQuery();
- // }
- // catch (SqliteSyntaxException)
- // {
- // m_log.Warn("[REGION DB]: Terrain Table Already Exists");
- // }
-
- // try
- // {
- // lcmd.ExecuteNonQuery();
- // }
- // catch (SqliteSyntaxException)
- // {
- // m_log.Warn("[REGION DB]: Land Table Already Exists");
- // }
-
- // try
- // {
- // lalcmd.ExecuteNonQuery();
- // }
- // catch (SqliteSyntaxException)
- // {
- // m_log.Warn("[SQLITE]: LandAccessList Table Already Exists");
- // }
- // }
-
- ///
- ///
- ///
- ///
- ///
- ///
- private bool TestTables(SqliteConnection conn, Migration m)
- {
- SqliteCommand primSelectCmd = new SqliteCommand(primSelect, conn);
- SqliteDataAdapter pDa = new SqliteDataAdapter(primSelectCmd);
-
- SqliteCommand shapeSelectCmd = new SqliteCommand(shapeSelect, conn);
- SqliteDataAdapter sDa = new SqliteDataAdapter(shapeSelectCmd);
-
- SqliteCommand itemsSelectCmd = new SqliteCommand(itemsSelect, conn);
- SqliteDataAdapter iDa = new SqliteDataAdapter(itemsSelectCmd);
-
- SqliteCommand terrainSelectCmd = new SqliteCommand(terrainSelect, conn);
- SqliteDataAdapter tDa = new SqliteDataAdapter(terrainSelectCmd);
-
- SqliteCommand landSelectCmd = new SqliteCommand(landSelect, conn);
- SqliteDataAdapter lDa = new SqliteDataAdapter(landSelectCmd);
-
- SqliteCommand landAccessListSelectCmd = new SqliteCommand(landAccessListSelect, conn);
- SqliteDataAdapter lalDa = new SqliteDataAdapter(landAccessListSelectCmd);
-
- DataSet tmpDS = new DataSet();
- try
- {
- pDa.Fill(tmpDS, "prims");
- sDa.Fill(tmpDS, "primshapes");
-
- iDa.Fill(tmpDS, "primitems");
-
- tDa.Fill(tmpDS, "terrain");
- lDa.Fill(tmpDS, "land");
- lalDa.Fill(tmpDS, "landaccesslist");
- }
- catch (SqliteSyntaxException)
- {
- m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
- return false;
- }
-
- // if we've gotten this far, and our version is still 0,
- // it's because the migration was never done, so
- // initialize to 1 just to sync up to where we should be.
-
- if (m.Version == 0)
- m.Version = 1;
-
- // pDa.Fill(tmpDS, "prims");
- // sDa.Fill(tmpDS, "primshapes");
-
- // iDa.Fill(tmpDS, "primitems");
-
- // tDa.Fill(tmpDS, "terrain");
- // lDa.Fill(tmpDS, "land");
- // lalDa.Fill(tmpDS, "landaccesslist");
-
- // foreach (DataColumn col in createPrimTable().Columns)
- // {
- // if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName))
- // {
- // m_log.Info("[REGION DB]: Missing required column:" + col.ColumnName);
- // return false;
- // }
- // }
-
- // foreach (DataColumn col in createShapeTable().Columns)
- // {
- // if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName))
- // {
- // m_log.Info("[REGION DB]: Missing required column:" + col.ColumnName);
- // return false;
- // }
- // }
-
- // // XXX primitems should probably go here eventually
-
- // foreach (DataColumn col in createTerrainTable().Columns)
- // {
- // if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName))
- // {
- // m_log.Info("[REGION DB]: Missing require column:" + col.ColumnName);
- // return false;
- // }
- // }
-
- // foreach (DataColumn col in createLandTable().Columns)
- // {
- // if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName))
- // {
- // m_log.Info("[REGION DB]: Missing require column:" + col.ColumnName);
- // return false;
- // }
- // }
-
- // foreach (DataColumn col in createLandAccessListTable().Columns)
- // {
- // if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName))
- // {
- // m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
- // return false;
- // }
- // }
-
- return true;
- }
-
/***********************************************************************
*
* Type conversion functions
@@ -1951,37 +1761,5 @@ namespace OpenSim.Data.SQLite
}
}
- ///
- ///
- /// a Type
- /// an sqliteType
- /// this is something we'll need to implement for each db slightly differently.
- // private static string sqliteType(Type type)
- // {
- // if (type == typeof (String))
- // {
- // return "varchar(255)";
- // }
- // else if (type == typeof (Int32))
- // {
- // return "integer";
- // }
- // else if (type == typeof (Int64))
- // {
- // return "integer";
- // }
- // else if (type == typeof (Double))
- // {
- // return "float";
- // }
- // else if (type == typeof (Byte[]))
- // {
- // return "blob";
- // }
- // else
- // {
- // return "string";
- // }
- // }
}
}
--
cgit v1.1