diff options
author | Justin Clarke Casey | 2009-02-19 18:09:10 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-02-19 18:09:10 +0000 |
commit | 07609565617aa7936758acba5fd625877564a10d (patch) | |
tree | 73123e37f14fea5f171cbe04753c21758f25afc1 /OpenSim/Data/MSSQL/Resources/004_InventoryStore.sql | |
parent | * Okay, so finally got my head around this. Problem is that upstream Prebuild... (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/004_InventoryStore.sql | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/004_InventoryStore.sql b/OpenSim/Data/MSSQL/Resources/004_InventoryStore.sql new file mode 100644 index 0000000..96ef1c0 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/004_InventoryStore.sql | |||
@@ -0,0 +1,52 @@ | |||
1 | BEGIN TRANSACTION | ||
2 | |||
3 | CREATE TABLE dbo.Tmp_inventoryitems | ||
4 | ( | ||
5 | inventoryID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
6 | assetID uniqueidentifier NULL DEFAULT (NULL), | ||
7 | assetType int NULL DEFAULT (NULL), | ||
8 | parentFolderID uniqueidentifier NULL DEFAULT (NULL), | ||
9 | avatarID uniqueidentifier NULL DEFAULT (NULL), | ||
10 | inventoryName varchar(64) NULL DEFAULT (NULL), | ||
11 | inventoryDescription varchar(128) NULL DEFAULT (NULL), | ||
12 | inventoryNextPermissions int NULL DEFAULT (NULL), | ||
13 | inventoryCurrentPermissions int NULL DEFAULT (NULL), | ||
14 | invType int NULL DEFAULT (NULL), | ||
15 | creatorID uniqueidentifier NULL DEFAULT (NULL), | ||
16 | inventoryBasePermissions int NOT NULL DEFAULT ((0)), | ||
17 | inventoryEveryOnePermissions int NOT NULL DEFAULT ((0)), | ||
18 | salePrice int NULL DEFAULT (NULL), | ||
19 | saleType tinyint NULL DEFAULT (NULL), | ||
20 | creationDate int NULL DEFAULT (NULL), | ||
21 | groupID uniqueidentifier NULL DEFAULT (NULL), | ||
22 | groupOwned bit NULL DEFAULT (NULL), | ||
23 | flags int NULL DEFAULT (NULL), | ||
24 | inventoryGroupPermissions int NOT NULL DEFAULT ((0)) | ||
25 | ) ON [PRIMARY] | ||
26 | |||
27 | IF EXISTS(SELECT * FROM dbo.inventoryitems) | ||
28 | EXEC('INSERT INTO dbo.Tmp_inventoryitems (inventoryID, assetID, assetType, parentFolderID, avatarID, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryGroupPermissions) | ||
29 | SELECT CONVERT(uniqueidentifier, inventoryID), CONVERT(uniqueidentifier, assetID), assetType, CONVERT(uniqueidentifier, parentFolderID), CONVERT(uniqueidentifier, avatarID), inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, CONVERT(uniqueidentifier, creatorID), inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, CONVERT(uniqueidentifier, groupID), groupOwned, flags, inventoryGroupPermissions FROM dbo.inventoryitems WITH (HOLDLOCK TABLOCKX)') | ||
30 | |||
31 | DROP TABLE dbo.inventoryitems | ||
32 | |||
33 | EXECUTE sp_rename N'dbo.Tmp_inventoryitems', N'inventoryitems', 'OBJECT' | ||
34 | |||
35 | ALTER TABLE dbo.inventoryitems ADD CONSTRAINT | ||
36 | PK__inventor__C4B7BC2220C1E124 PRIMARY KEY CLUSTERED | ||
37 | ( | ||
38 | inventoryID | ||
39 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
40 | |||
41 | |||
42 | CREATE NONCLUSTERED INDEX owner ON dbo.inventoryitems | ||
43 | ( | ||
44 | avatarID | ||
45 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
46 | |||
47 | CREATE NONCLUSTERED INDEX folder ON dbo.inventoryitems | ||
48 | ( | ||
49 | parentFolderID | ||
50 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
51 | |||
52 | COMMIT | ||