1
0

GridStore.migrations 7.5 KB

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