diff options
author | Melanie | 2010-05-09 17:04:23 +0100 |
---|---|---|
committer | Melanie | 2010-05-09 17:04:23 +0100 |
commit | 4e0d62547d2760ce48cf64373917dcfb893da543 (patch) | |
tree | 9f84ddc57b58ed107cd6d610aaeb62039d483a71 /OpenSim/Data | |
parent | Merge branch 'careminster' into careminster-presence-refactor (diff) | |
parent | Add a field asset_flags and a corresponding enum to the asset database. This (diff) | |
download | opensim-SC-4e0d62547d2760ce48cf64373917dcfb893da543.zip opensim-SC-4e0d62547d2760ce48cf64373917dcfb893da543.tar.gz opensim-SC-4e0d62547d2760ce48cf64373917dcfb893da543.tar.bz2 opensim-SC-4e0d62547d2760ce48cf64373917dcfb893da543.tar.xz |
Merge branch 'master' into careminster-presence-refactor
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; | ||