1
0

EstateStore.migrations 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. :VERSION 1
  2. BEGIN TRANSACTION;
  3. CREATE TABLE estate_managers(
  4. "EstateID" int NOT NULL Primary Key,
  5. uuid varchar(36) NOT NULL
  6. );
  7. CREATE TABLE estate_groups(
  8. "EstateID" int NOT NULL,
  9. uuid varchar(36) NOT NULL
  10. );
  11. CREATE TABLE estate_users(
  12. "EstateID" int NOT NULL,
  13. uuid varchar(36) NOT NULL
  14. );
  15. CREATE TABLE estateban(
  16. "EstateID" int NOT NULL,
  17. "bannedUUID" varchar(36) NOT NULL,
  18. "bannedIp" varchar(16) NOT NULL,
  19. "bannedIpHostMask" varchar(16) NOT NULL,
  20. "bannedNameMask" varchar(64) NULL DEFAULT NULL
  21. );
  22. Create Sequence estate_settings_id increment by 100 start with 100;
  23. CREATE TABLE estate_settings(
  24. "EstateID" integer DEFAULT nextval('estate_settings_id') NOT NULL,
  25. "EstateName" varchar(64) NULL DEFAULT (NULL),
  26. "AbuseEmailToEstateOwner" boolean NOT NULL,
  27. "DenyAnonymous" boolean NOT NULL,
  28. "ResetHomeOnTeleport" boolean NOT NULL,
  29. "FixedSun" boolean NOT NULL,
  30. "DenyTransacted" boolean NOT NULL,
  31. "BlockDwell" boolean NOT NULL,
  32. "DenyIdentified" boolean NOT NULL,
  33. "AllowVoice" boolean NOT NULL,
  34. "UseGlobalTime" boolean NOT NULL,
  35. "PricePerMeter" int NOT NULL,
  36. "TaxFree" boolean NOT NULL,
  37. "AllowDirectTeleport" boolean NOT NULL,
  38. "RedirectGridX" int NOT NULL,
  39. "RedirectGridY" int NOT NULL,
  40. "ParentEstateID" int NOT NULL,
  41. "SunPosition" double precision NOT NULL,
  42. "EstateSkipScripts" boolean NOT NULL,
  43. "BillableFactor" double precision NOT NULL,
  44. "PublicAccess" boolean NOT NULL,
  45. "AbuseEmail" varchar(255) NOT NULL,
  46. "EstateOwner" varchar(36) NOT NULL,
  47. "DenyMinors" boolean NOT NULL
  48. );
  49. CREATE TABLE estate_map(
  50. "RegionID" varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
  51. "EstateID" int NOT NULL
  52. );
  53. COMMIT;
  54. :VERSION 2
  55. BEGIN TRANSACTION;
  56. CREATE INDEX IX_estate_managers ON estate_managers
  57. (
  58. "EstateID"
  59. );
  60. CREATE INDEX IX_estate_groups ON estate_groups
  61. (
  62. "EstateID"
  63. );
  64. CREATE INDEX IX_estate_users ON estate_users
  65. (
  66. "EstateID"
  67. );
  68. COMMIT;
  69. :VERSION 3
  70. BEGIN TRANSACTION;
  71. CREATE TABLE Tmp_estateban
  72. (
  73. "EstateID" int NOT NULL,
  74. "bannedUUID" varchar(36) NOT NULL,
  75. "bannedIp" varchar(16) NULL,
  76. "bannedIpHostMask" varchar(16) NULL,
  77. "bannedNameMask" varchar(64) NULL
  78. );
  79. INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask")
  80. SELECT "EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban;
  81. DROP TABLE estateban;
  82. Alter table Tmp_estateban
  83. rename to estateban;
  84. CREATE INDEX IX_estateban ON estateban
  85. (
  86. "EstateID"
  87. );
  88. COMMIT;
  89. :VERSION 4
  90. BEGIN TRANSACTION;
  91. CREATE TABLE Tmp_estate_managers
  92. (
  93. "EstateID" int NOT NULL,
  94. uuid uuid NOT NULL
  95. );
  96. INSERT INTO Tmp_estate_managers ("EstateID", uuid)
  97. SELECT "EstateID", cast(uuid as uuid) FROM estate_managers;
  98. DROP TABLE estate_managers;
  99. Alter table Tmp_estate_managers
  100. rename to estate_managers;
  101. CREATE INDEX IX_estate_managers ON estate_managers
  102. (
  103. "EstateID"
  104. );
  105. COMMIT;
  106. :VERSION 5
  107. BEGIN TRANSACTION;
  108. CREATE TABLE Tmp_estate_groups
  109. (
  110. "EstateID" int NOT NULL,
  111. uuid uuid NOT NULL
  112. ) ;
  113. INSERT INTO Tmp_estate_groups ("EstateID", uuid)
  114. SELECT "EstateID", cast(uuid as uuid) FROM estate_groups;
  115. DROP TABLE estate_groups;
  116. Alter table Tmp_estate_groups
  117. rename to estate_groups;
  118. CREATE INDEX IX_estate_groups ON estate_groups
  119. (
  120. "EstateID"
  121. );
  122. COMMIT;
  123. :VERSION 6
  124. BEGIN TRANSACTION;
  125. CREATE TABLE Tmp_estate_users
  126. (
  127. "EstateID" int NOT NULL,
  128. uuid uuid NOT NULL
  129. );
  130. INSERT INTO Tmp_estate_users ("EstateID", uuid)
  131. SELECT "EstateID", cast(uuid as uuid) FROM estate_users ;
  132. DROP TABLE estate_users;
  133. Alter table Tmp_estate_users
  134. rename to estate_users;
  135. CREATE INDEX IX_estate_users ON estate_users
  136. (
  137. "EstateID"
  138. );
  139. COMMIT;
  140. :VERSION 7
  141. BEGIN TRANSACTION;
  142. CREATE TABLE Tmp_estateban
  143. (
  144. "EstateID" int NOT NULL,
  145. "bannedUUID" uuid NOT NULL,
  146. "bannedIp" varchar(16) NULL,
  147. "bannedIpHostMask" varchar(16) NULL,
  148. "bannedNameMask" varchar(64) NULL
  149. );
  150. INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask")
  151. SELECT "EstateID", cast("bannedUUID" as uuid), "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban ;
  152. DROP TABLE estateban;
  153. Alter table Tmp_estateban
  154. rename to estateban;
  155. CREATE INDEX IX_estateban ON estateban
  156. (
  157. "EstateID"
  158. );
  159. COMMIT;
  160. :VERSION 8
  161. BEGIN TRANSACTION;
  162. CREATE TABLE Tmp_estate_settings
  163. (
  164. "EstateID" integer default nextval('estate_settings_id') NOT NULL,
  165. "EstateName" varchar(64) NULL DEFAULT (NULL),
  166. "AbuseEmailToEstateOwner" boolean NOT NULL,
  167. "DenyAnonymous" boolean NOT NULL,
  168. "ResetHomeOnTeleport" boolean NOT NULL,
  169. "FixedSun" boolean NOT NULL,
  170. "DenyTransacted" boolean NOT NULL,
  171. "BlockDwell" boolean NOT NULL,
  172. "DenyIdentified" boolean NOT NULL,
  173. "AllowVoice" boolean NOT NULL,
  174. "UseGlobalTime" boolean NOT NULL,
  175. "PricePerMeter" int NOT NULL,
  176. "TaxFree" boolean NOT NULL,
  177. "AllowDirectTeleport" boolean NOT NULL,
  178. "RedirectGridX" int NOT NULL,
  179. "RedirectGridY" int NOT NULL,
  180. "ParentEstateID" int NOT NULL,
  181. "SunPosition" double precision NOT NULL,
  182. "EstateSkipScripts" boolean NOT NULL,
  183. "BillableFactor" double precision NOT NULL,
  184. "PublicAccess" boolean NOT NULL,
  185. "AbuseEmail" varchar(255) NOT NULL,
  186. "EstateOwner" uuid NOT NULL,
  187. "DenyMinors" boolean NOT NULL
  188. );
  189. INSERT INTO Tmp_estate_settings ("EstateID", "EstateName", "AbuseEmailToEstateOwner", "DenyAnonymous", "ResetHomeOnTeleport", "FixedSun", "DenyTransacted", "BlockDwell", "DenyIdentified", "AllowVoice", "UseGlobalTime", "PricePerMeter", "TaxFree", "AllowDirectTeleport", "RedirectGridX", "RedirectGridY", "ParentEstateID", "SunPosition", "EstateSkipScripts", "BillableFactor", "PublicAccess", "AbuseEmail", "EstateOwner", "DenyMinors")
  190. SELECT "EstateID", "EstateName", "AbuseEmailToEstateOwner", "DenyAnonymous", "ResetHomeOnTeleport", "FixedSun", "DenyTransacted", "BlockDwell", "DenyIdentified", "AllowVoice", "UseGlobalTime", "PricePerMeter", "TaxFree", "AllowDirectTeleport", "RedirectGridX", "RedirectGridY", "ParentEstateID", "SunPosition", "EstateSkipScripts", "BillableFactor", "PublicAccess", "AbuseEmail", cast("EstateOwner" as uuid), "DenyMinors" FROM estate_settings ;
  191. DROP TABLE estate_settings;
  192. Alter table Tmp_estate_settings
  193. rename to estate_settings;
  194. Create index on estate_settings (lower("EstateName"));
  195. COMMIT;
  196. :VERSION 9
  197. BEGIN TRANSACTION;
  198. CREATE TABLE Tmp_estate_map
  199. (
  200. "RegionID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
  201. "EstateID" int NOT NULL
  202. );
  203. INSERT INTO Tmp_estate_map ("RegionID", "EstateID")
  204. SELECT cast("RegionID" as uuid), "EstateID" FROM estate_map ;
  205. DROP TABLE estate_map;
  206. Alter table Tmp_estate_map
  207. rename to estate_map;
  208. COMMIT;
  209. :VERSION 10
  210. BEGIN TRANSACTION;
  211. ALTER TABLE estate_settings ADD COLUMN "AllowLandmark" boolean NOT NULL default true;
  212. ALTER TABLE estate_settings ADD COLUMN "AllowParcelChanges" boolean NOT NULL default true;
  213. ALTER TABLE estate_settings ADD COLUMN "AllowSetHome" boolean NOT NULL default true;
  214. COMMIT;
  215. :VERSION 11
  216. Begin transaction;
  217. Commit;