aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/004_AssetStore.sql
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-19 18:09:10 +0000
committerJustin Clarke Casey2009-02-19 18:09:10 +0000
commit07609565617aa7936758acba5fd625877564a10d (patch)
tree73123e37f14fea5f171cbe04753c21758f25afc1 /OpenSim/Data/MSSQL/Resources/004_AssetStore.sql
parent* Okay, so finally got my head around this. Problem is that upstream Prebuild... (diff)
downloadopensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.zip
opensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.tar.gz
opensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.tar.bz2
opensim-SC_OLD-07609565617aa7936758acba5fd625877564a10d.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=3142
* Changes varchar(36) columns to UUID type in MSSQL - this will be much more efficient * ===As always, please, please backup your database before applying this patch=== * Thanks Ruud Lathrop (for the patch) and StrawberryFride (for the review)
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources/004_AssetStore.sql')
-rw-r--r--OpenSim/Data/MSSQL/Resources/004_AssetStore.sql31
1 files changed, 31 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/004_AssetStore.sql b/OpenSim/Data/MSSQL/Resources/004_AssetStore.sql
new file mode 100644
index 0000000..215cf3a
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/004_AssetStore.sql
@@ -0,0 +1,31 @@
1BEGIN TRANSACTION
2
3CREATE TABLE dbo.Tmp_assets
4 (
5 id uniqueidentifier NOT NULL,
6 name varchar(64) NOT NULL,
7 description varchar(64) NOT NULL,
8 assetType tinyint NOT NULL,
9 local bit NOT NULL,
10 temporary bit NOT NULL,
11 data image NOT NULL,
12 create_time int NULL,
13 access_time int NULL
14 ) ON [PRIMARY]
15 TEXTIMAGE_ON [PRIMARY]
16
17IF EXISTS(SELECT * FROM dbo.assets)
18 EXEC('INSERT INTO dbo.Tmp_assets (id, name, description, assetType, local, temporary, data, create_time, access_time)
19 SELECT CONVERT(uniqueidentifier, id), name, description, assetType, local, temporary, data, create_time, access_time FROM dbo.assets WITH (HOLDLOCK TABLOCKX)')
20
21DROP TABLE assets
22
23EXECUTE sp_rename N'Tmp_assets', N'assets', 'OBJECT'
24
25ALTER TABLE dbo.assets ADD CONSTRAINT
26 PK__assets__id PRIMARY KEY CLUSTERED
27 (
28 id
29 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
30
31COMMIT