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/015_RegionStore.sql | |
parent | * Okay, so finally got my head around this. Problem is that upstream Prebuild... (diff) | |
download | opensim-SC-07609565617aa7936758acba5fd625877564a10d.zip opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.gz opensim-SC-07609565617aa7936758acba5fd625877564a10d.tar.bz2 opensim-SC-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/015_RegionStore.sql')
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/015_RegionStore.sql | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/015_RegionStore.sql b/OpenSim/Data/MSSQL/Resources/015_RegionStore.sql new file mode 100644 index 0000000..cbaaf88 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/015_RegionStore.sql | |||
@@ -0,0 +1,45 @@ | |||
1 | BEGIN TRANSACTION | ||
2 | |||
3 | CREATE TABLE dbo.Tmp_primitems | ||
4 | ( | ||
5 | itemID uniqueidentifier NOT NULL, | ||
6 | primID uniqueidentifier NULL, | ||
7 | assetID uniqueidentifier NULL, | ||
8 | parentFolderID uniqueidentifier NULL, | ||
9 | invType int NULL, | ||
10 | assetType int NULL, | ||
11 | name varchar(255) NULL, | ||
12 | description varchar(255) NULL, | ||
13 | creationDate varchar(255) NULL, | ||
14 | creatorID uniqueidentifier NULL, | ||
15 | ownerID uniqueidentifier NULL, | ||
16 | lastOwnerID uniqueidentifier NULL, | ||
17 | groupID uniqueidentifier NULL, | ||
18 | nextPermissions int NULL, | ||
19 | currentPermissions int NULL, | ||
20 | basePermissions int NULL, | ||
21 | everyonePermissions int NULL, | ||
22 | groupPermissions int NULL, | ||
23 | flags int NOT NULL DEFAULT ((0)) | ||
24 | ) ON [PRIMARY] | ||
25 | |||
26 | IF EXISTS(SELECT * FROM dbo.primitems) | ||
27 | EXEC('INSERT INTO dbo.Tmp_primitems (itemID, primID, assetID, parentFolderID, invType, assetType, name, description, creationDate, creatorID, ownerID, lastOwnerID, groupID, nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions, flags) | ||
28 | SELECT CONVERT(uniqueidentifier, itemID), CONVERT(uniqueidentifier, primID), CONVERT(uniqueidentifier, assetID), CONVERT(uniqueidentifier, parentFolderID), invType, assetType, name, description, creationDate, CONVERT(uniqueidentifier, creatorID), CONVERT(uniqueidentifier, ownerID), CONVERT(uniqueidentifier, lastOwnerID), CONVERT(uniqueidentifier, groupID), nextPermissions, currentPermissions, basePermissions, everyonePermissions, groupPermissions, flags FROM dbo.primitems WITH (HOLDLOCK TABLOCKX)') | ||
29 | |||
30 | DROP TABLE dbo.primitems | ||
31 | |||
32 | EXECUTE sp_rename N'dbo.Tmp_primitems', N'primitems', 'OBJECT' | ||
33 | |||
34 | ALTER TABLE dbo.primitems ADD CONSTRAINT | ||
35 | PK__primitems__0A688BB1 PRIMARY KEY CLUSTERED | ||
36 | ( | ||
37 | itemID | ||
38 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
39 | |||
40 | CREATE NONCLUSTERED INDEX primitems_primid ON dbo.primitems | ||
41 | ( | ||
42 | primID | ||
43 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
44 | |||
45 | COMMIT | ||