mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
* 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)
This commit is contained in:
19
OpenSim/Data/MSSQL/Resources/016_RegionStore.sql
Normal file
19
OpenSim/Data/MSSQL/Resources/016_RegionStore.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE dbo.Tmp_terrain
|
||||
(
|
||||
RegionUUID uniqueidentifier NULL,
|
||||
Revision int NULL,
|
||||
Heightfield image NULL
|
||||
) ON [PRIMARY]
|
||||
TEXTIMAGE_ON [PRIMARY]
|
||||
|
||||
IF EXISTS(SELECT * FROM dbo.terrain)
|
||||
EXEC('INSERT INTO dbo.Tmp_terrain (RegionUUID, Revision, Heightfield)
|
||||
SELECT CONVERT(uniqueidentifier, RegionUUID), Revision, Heightfield FROM dbo.terrain WITH (HOLDLOCK TABLOCKX)')
|
||||
|
||||
DROP TABLE dbo.terrain
|
||||
|
||||
EXECUTE sp_rename N'dbo.Tmp_terrain', N'terrain', 'OBJECT'
|
||||
|
||||
COMMIT
|
||||
Reference in New Issue
Block a user