From 7f8552fe63df19913364d04b133adf5856eed11a Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 9 Apr 2009 19:23:19 +0000 Subject: * Change SQLite asset UUID to dashed format to be consistent * Remaining inconsistent uuids (non dashed) are in region store for sqlite and mysql * Migration of these will happen at a later date, unless someone else wants to do it --- OpenSim/Data/SQLite/Resources/004_AssetStore.sql | 7 +++++++ OpenSim/Data/SQLite/SQLiteAssetData.cs | 12 ++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 OpenSim/Data/SQLite/Resources/004_AssetStore.sql diff --git a/OpenSim/Data/SQLite/Resources/004_AssetStore.sql b/OpenSim/Data/SQLite/Resources/004_AssetStore.sql new file mode 100644 index 0000000..721f2b5 --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/004_AssetStore.sql @@ -0,0 +1,7 @@ +BEGIN; + +update assets + set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21) + where UUID not like '%-%'; + +COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 6a323e1..5a5260a 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -102,7 +102,7 @@ namespace OpenSim.Data.SQLite { using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) { - cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid))); + cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString())); using (IDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -127,7 +127,7 @@ namespace OpenSim.Data.SQLite /// Asset Base override public void CreateAsset(AssetBase asset) { - //m_log.Info("[ASSET DB]: Creating Asset " + Util.ToRawUuidString(asset.FullID)); + //m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString()); if (ExistsAsset(asset.FullID)) { //m_log.Info("[ASSET DB]: Asset exists already, ignoring."); @@ -138,7 +138,7 @@ namespace OpenSim.Data.SQLite { using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn)) { - cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); + cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); @@ -164,7 +164,7 @@ namespace OpenSim.Data.SQLite { using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn)) { - cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID))); + cmd.Parameters.Add(new SqliteParameter(":UUID", asset.FullID.ToString())); cmd.Parameters.Add(new SqliteParameter(":Name", asset.Name)); cmd.Parameters.Add(new SqliteParameter(":Description", asset.Description)); cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); @@ -204,7 +204,7 @@ namespace OpenSim.Data.SQLite lock (this) { using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn)) { - cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid))); + cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString())); using (IDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) @@ -230,7 +230,7 @@ namespace OpenSim.Data.SQLite { using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn)) { - cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid))); + cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString())); cmd.ExecuteNonQuery(); } -- cgit v1.1