diff options
author | Melanie | 2010-05-09 17:02:22 +0100 |
---|---|---|
committer | Melanie | 2010-05-09 17:02:22 +0100 |
commit | 9b22393cf308507dc751704c8b0d3e65ac1d4323 (patch) | |
tree | 4e7605aa485d79bb429ca5965fd6415bb53cb635 /OpenSim/Data | |
parent | * Added missing loggout notification to home grid upon agents logging out in ... (diff) | |
download | opensim-SC-9b22393cf308507dc751704c8b0d3e65ac1d4323.zip opensim-SC-9b22393cf308507dc751704c8b0d3e65ac1d4323.tar.gz opensim-SC-9b22393cf308507dc751704c8b0d3e65ac1d4323.tar.bz2 opensim-SC-9b22393cf308507dc751704c8b0d3e65ac1d4323.tar.xz |
Add a field asset_flags and a corresponding enum to the asset database. This
CHANGES THE ASSET SERVER PROTOCOL and means you CAN NOT MIX PRIOR VERSIONS
WITH LATER ONES. It may also eat your babies, yada, yada, yada.
The usual cautions for migrations to the assets table apply.
Coding: Can not guarantee nut free.
Diffstat (limited to 'OpenSim/Data')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/007_AssetStore.sql | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index d55369a..5a2af4f 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -161,8 +161,8 @@ namespace OpenSim.Data.MySQL | |||
161 | 161 | ||
162 | MySqlCommand cmd = | 162 | MySqlCommand cmd = |
163 | new MySqlCommand( | 163 | new MySqlCommand( |
164 | "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, data)" + | 164 | "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, data)" + |
165 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", | 165 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?data)", |
166 | dbcon); | 166 | dbcon); |
167 | 167 | ||
168 | string assetName = asset.Name; | 168 | string assetName = asset.Name; |
@@ -194,6 +194,7 @@ namespace OpenSim.Data.MySQL | |||
194 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); | 194 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); |
195 | cmd.Parameters.AddWithValue("?create_time", now); | 195 | cmd.Parameters.AddWithValue("?create_time", now); |
196 | cmd.Parameters.AddWithValue("?access_time", now); | 196 | cmd.Parameters.AddWithValue("?access_time", now); |
197 | cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags); | ||
197 | cmd.Parameters.AddWithValue("?data", asset.Data); | 198 | cmd.Parameters.AddWithValue("?data", asset.Data); |
198 | cmd.ExecuteNonQuery(); | 199 | cmd.ExecuteNonQuery(); |
199 | cmd.Dispose(); | 200 | cmd.Dispose(); |
@@ -302,7 +303,7 @@ namespace OpenSim.Data.MySQL | |||
302 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 303 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
303 | { | 304 | { |
304 | dbcon.Open(); | 305 | dbcon.Open(); |
305 | MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id FROM assets LIMIT ?start, ?count", dbcon); | 306 | MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags FROM assets LIMIT ?start, ?count", dbcon); |
306 | cmd.Parameters.AddWithValue("?start", start); | 307 | cmd.Parameters.AddWithValue("?start", start); |
307 | cmd.Parameters.AddWithValue("?count", count); | 308 | cmd.Parameters.AddWithValue("?count", count); |
308 | 309 | ||
@@ -317,6 +318,7 @@ namespace OpenSim.Data.MySQL | |||
317 | metadata.Description = (string)dbReader["description"]; | 318 | metadata.Description = (string)dbReader["description"]; |
318 | metadata.Type = (sbyte)dbReader["assetType"]; | 319 | metadata.Type = (sbyte)dbReader["assetType"]; |
319 | metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. | 320 | metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. |
321 | metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]); | ||
320 | metadata.FullID = new UUID((string)dbReader["id"]); | 322 | metadata.FullID = new UUID((string)dbReader["id"]); |
321 | 323 | ||
322 | // Current SHA1s are not stored/computed. | 324 | // Current SHA1s are not stored/computed. |
diff --git a/OpenSim/Data/MySQL/Resources/007_AssetStore.sql b/OpenSim/Data/MySQL/Resources/007_AssetStore.sql new file mode 100644 index 0000000..f06121a --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/007_AssetStore.sql | |||
@@ -0,0 +1,5 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0; | ||
4 | |||
5 | COMMIT; | ||