GridStore.migrations 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. :VERSION 1
  2. BEGIN TRANSACTION
  3. CREATE TABLE [dbo].[regions](
  4. [regionHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  5. [regionName] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  6. [uuid] [varchar](255) COLLATE Latin1_General_CI_AS NOT NULL,
  7. [regionRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  8. [regionSecret] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  9. [regionSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  10. [regionDataURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  11. [serverIP] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  12. [serverPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  13. [serverURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  14. [locX] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  15. [locY] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  16. [locZ] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  17. [eastOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  18. [westOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  19. [southOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  20. [northOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  21. [regionAssetURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  22. [regionAssetRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  23. [regionAssetSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  24. [regionUserURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  25. [regionUserRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  26. [regionUserSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  27. [regionMapTexture] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  28. [serverHttpPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  29. [serverRemotingPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL,
  30. [owner_uuid] [varchar](36) COLLATE Latin1_General_CI_AS NULL,
  31. PRIMARY KEY CLUSTERED
  32. (
  33. [uuid] ASC
  34. )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
  35. ) ON [PRIMARY]
  36. COMMIT
  37. :VERSION 2
  38. BEGIN TRANSACTION
  39. CREATE TABLE Tmp_regions
  40. (
  41. uuid varchar(36) COLLATE Latin1_General_CI_AS NOT NULL,
  42. regionHandle bigint NULL,
  43. regionName varchar(20) NULL,
  44. regionRecvKey varchar(128) NULL,
  45. regionSendKey varchar(128) NULL,
  46. regionSecret varchar(128) NULL,
  47. regionDataURI varchar(128) NULL,
  48. serverIP varchar(64) NULL,
  49. serverPort int NULL,
  50. serverURI varchar(255) NULL,
  51. locX int NULL,
  52. locY int NULL,
  53. locZ int NULL,
  54. eastOverrideHandle bigint NULL,
  55. westOverrideHandle bigint NULL,
  56. southOverrideHandle bigint NULL,
  57. northOverrideHandle bigint NULL,
  58. regionAssetURI varchar(255) NULL,
  59. regionAssetRecvKey varchar(128) NULL,
  60. regionAssetSendKey varchar(128) NULL,
  61. regionUserURI varchar(255) NULL,
  62. regionUserRecvKey varchar(128) NULL,
  63. regionUserSendKey varchar(128) NULL,
  64. regionMapTexture varchar(36) NULL,
  65. serverHttpPort int NULL,
  66. serverRemotingPort int NULL,
  67. owner_uuid varchar(36) NULL,
  68. originUUID varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
  69. ) ON [PRIMARY]
  70. IF EXISTS(SELECT * FROM regions)
  71. 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)
  72. 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')
  73. DROP TABLE regions
  74. EXECUTE sp_rename N'Tmp_regions', N'regions', 'OBJECT'
  75. ALTER TABLE regions ADD CONSTRAINT
  76. PK__regions__uuid PRIMARY KEY CLUSTERED
  77. (
  78. uuid
  79. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  80. COMMIT
  81. :VERSION 3
  82. BEGIN TRANSACTION
  83. CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
  84. (
  85. regionName
  86. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  87. CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions
  88. (
  89. regionHandle
  90. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  91. CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions
  92. (
  93. eastOverrideHandle,
  94. westOverrideHandle,
  95. southOverrideHandle,
  96. northOverrideHandle
  97. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  98. COMMIT
  99. :VERSION 4
  100. /* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
  101. BEGIN TRANSACTION
  102. CREATE TABLE dbo.Tmp_regions
  103. (
  104. uuid uniqueidentifier NOT NULL,
  105. regionHandle bigint NULL,
  106. regionName varchar(20) NULL,
  107. regionRecvKey varchar(128) NULL,
  108. regionSendKey varchar(128) NULL,
  109. regionSecret varchar(128) NULL,
  110. regionDataURI varchar(128) NULL,
  111. serverIP varchar(64) NULL,
  112. serverPort int NULL,
  113. serverURI varchar(255) NULL,
  114. locX int NULL,
  115. locY int NULL,
  116. locZ int NULL,
  117. eastOverrideHandle bigint NULL,
  118. westOverrideHandle bigint NULL,
  119. southOverrideHandle bigint NULL,
  120. northOverrideHandle bigint NULL,
  121. regionAssetURI varchar(255) NULL,
  122. regionAssetRecvKey varchar(128) NULL,
  123. regionAssetSendKey varchar(128) NULL,
  124. regionUserURI varchar(255) NULL,
  125. regionUserRecvKey varchar(128) NULL,
  126. regionUserSendKey varchar(128) NULL,
  127. regionMapTexture uniqueidentifier NULL,
  128. serverHttpPort int NULL,
  129. serverRemotingPort int NULL,
  130. owner_uuid uniqueidentifier NOT NULL,
  131. originUUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000')
  132. ) ON [PRIMARY]
  133. IF EXISTS(SELECT * FROM dbo.regions)
  134. EXEC('INSERT INTO dbo.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, originUUID)
  135. SELECT CONVERT(uniqueidentifier, uuid), regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, CONVERT(uniqueidentifier, regionMapTexture), serverHttpPort, serverRemotingPort, CONVERT(uniqueidentifier, owner_uuid), CONVERT(uniqueidentifier, originUUID) FROM dbo.regions WITH (HOLDLOCK TABLOCKX)')
  136. DROP TABLE dbo.regions
  137. EXECUTE sp_rename N'dbo.Tmp_regions', N'regions', 'OBJECT'
  138. ALTER TABLE dbo.regions ADD CONSTRAINT
  139. PK__regions__uuid PRIMARY KEY CLUSTERED
  140. (
  141. uuid
  142. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  143. CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
  144. (
  145. regionName
  146. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  147. CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions
  148. (
  149. regionHandle
  150. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  151. CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions
  152. (
  153. eastOverrideHandle,
  154. westOverrideHandle,
  155. southOverrideHandle,
  156. northOverrideHandle
  157. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  158. COMMIT
  159. :VERSION 5
  160. BEGIN TRANSACTION
  161. ALTER TABLE regions ADD access int default 0;
  162. COMMIT
  163. :VERSION 6
  164. BEGIN TRANSACTION
  165. ALTER TABLE regions ADD scopeid uniqueidentifier default '00000000-0000-0000-0000-000000000000';
  166. ALTER TABLE regions ADD DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [owner_uuid];
  167. ALTER TABLE regions ADD sizeX integer not null default 0;
  168. ALTER TABLE regions ADD sizeY integer not null default 0;
  169. COMMIT
  170. :VERSION 7
  171. BEGIN TRANSACTION
  172. ALTER TABLE regions ADD [flags] integer NOT NULL DEFAULT 0;
  173. CREATE INDEX [flags] ON regions(flags);
  174. ALTER TABLE [regions] ADD [last_seen] integer NOT NULL DEFAULT 0;
  175. ALTER TABLE [regions] ADD [PrincipalID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
  176. ALTER TABLE [regions] ADD [Token] varchar(255) NOT NULL DEFAULT 0;
  177. COMMIT
  178. :VERSION 8
  179. BEGIN TRANSACTION
  180. ALTER TABLE regions ALTER COLUMN regionName VarChar(128)
  181. DROP INDEX IX_regions_name ON dbo.regions
  182. ALTER TABLE regions ALTER COLUMN regionName VarChar(128) null
  183. CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
  184. (
  185. regionName
  186. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  187. COMMIT
  188. :VERSION 9
  189. BEGIN TRANSACTION
  190. ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
  191. COMMIT