002_GridStore.sql 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. BEGIN TRANSACTION
  2. CREATE TABLE Tmp_regions
  3. (
  4. uuid varchar(36) COLLATE Latin1_General_CI_AS NOT NULL,
  5. regionHandle bigint NULL,
  6. regionName varchar(20) NULL,
  7. regionRecvKey varchar(128) NULL,
  8. regionSendKey varchar(128) NULL,
  9. regionSecret varchar(128) NULL,
  10. regionDataURI varchar(128) NULL,
  11. serverIP varchar(64) NULL,
  12. serverPort int NULL,
  13. serverURI varchar(255) NULL,
  14. locX int NULL,
  15. locY int NULL,
  16. locZ int NULL,
  17. eastOverrideHandle bigint NULL,
  18. westOverrideHandle bigint NULL,
  19. southOverrideHandle bigint NULL,
  20. northOverrideHandle bigint NULL,
  21. regionAssetURI varchar(255) NULL,
  22. regionAssetRecvKey varchar(128) NULL,
  23. regionAssetSendKey varchar(128) NULL,
  24. regionUserURI varchar(255) NULL,
  25. regionUserRecvKey varchar(128) NULL,
  26. regionUserSendKey varchar(128) NULL,
  27. regionMapTexture varchar(36) NULL,
  28. serverHttpPort int NULL,
  29. serverRemotingPort int NULL,
  30. owner_uuid varchar(36) NULL,
  31. originUUID varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
  32. ) ON [PRIMARY]
  33. IF EXISTS(SELECT * FROM regions)
  34. EXEC('INSERT INTO Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid)
  35. SELECT CONVERT(varchar(36), uuid), CONVERT(bigint, regionHandle), CONVERT(varchar(20), regionName), CONVERT(varchar(128), regionRecvKey), CONVERT(varchar(128), regionSendKey), CONVERT(varchar(128), regionSecret), CONVERT(varchar(128), regionDataURI), CONVERT(varchar(64), serverIP), CONVERT(int, serverPort), serverURI, CONVERT(int, locX), CONVERT(int, locY), CONVERT(int, locZ), CONVERT(bigint, eastOverrideHandle), CONVERT(bigint, westOverrideHandle), CONVERT(bigint, southOverrideHandle), CONVERT(bigint, northOverrideHandle), regionAssetURI, CONVERT(varchar(128), regionAssetRecvKey), CONVERT(varchar(128), regionAssetSendKey), regionUserURI, CONVERT(varchar(128), regionUserRecvKey), CONVERT(varchar(128), regionUserSendKey), CONVERT(varchar(36), regionMapTexture), CONVERT(int, serverHttpPort), CONVERT(int, serverRemotingPort), owner_uuid FROM regions')
  36. DROP TABLE regions
  37. EXECUTE sp_rename N'Tmp_regions', N'regions', 'OBJECT'
  38. ALTER TABLE regions ADD CONSTRAINT
  39. PK__regions__uuid PRIMARY KEY CLUSTERED
  40. (
  41. uuid
  42. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  43. COMMIT