EstateStore.migrations 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. :VERSION 1
  2. BEGIN TRANSACTION
  3. CREATE TABLE [dbo].[estate_managers](
  4. [EstateID] [int] NOT NULL,
  5. [uuid] [varchar](36) NOT NULL,
  6. CONSTRAINT [PK_estate_managers] PRIMARY KEY CLUSTERED
  7. (
  8. [EstateID] ASC
  9. )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
  10. ) ON [PRIMARY];
  11. CREATE TABLE [dbo].[estate_groups](
  12. [EstateID] [int] NOT NULL,
  13. [uuid] [varchar](36) NOT NULL,
  14. CONSTRAINT [PK_estate_groups] PRIMARY KEY CLUSTERED
  15. (
  16. [EstateID] ASC
  17. )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
  18. ) ON [PRIMARY];
  19. CREATE TABLE [dbo].[estate_users](
  20. [EstateID] [int] NOT NULL,
  21. [uuid] [varchar](36) NOT NULL,
  22. CONSTRAINT [PK_estate_users] PRIMARY KEY CLUSTERED
  23. (
  24. [EstateID] ASC
  25. )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
  26. ) ON [PRIMARY];
  27. CREATE TABLE [dbo].[estateban](
  28. [EstateID] [int] NOT NULL,
  29. [bannedUUID] [varchar](36) NOT NULL,
  30. [bannedIp] [varchar](16) NOT NULL,
  31. [bannedIpHostMask] [varchar](16) NOT NULL,
  32. [bannedNameMask] [varchar](64) NULL DEFAULT (NULL),
  33. CONSTRAINT [PK_estateban] PRIMARY KEY CLUSTERED
  34. (
  35. [EstateID] ASC
  36. )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
  37. ) ON [PRIMARY];
  38. CREATE TABLE [dbo].[estate_settings](
  39. [EstateID] [int] IDENTITY(1,100) NOT NULL,
  40. [EstateName] [varchar](64) NULL DEFAULT (NULL),
  41. [AbuseEmailToEstateOwner] [bit] NOT NULL,
  42. [DenyAnonymous] [bit] NOT NULL,
  43. [ResetHomeOnTeleport] [bit] NOT NULL,
  44. [FixedSun] [bit] NOT NULL,
  45. [DenyTransacted] [bit] NOT NULL,
  46. [BlockDwell] [bit] NOT NULL,
  47. [DenyIdentified] [bit] NOT NULL,
  48. [AllowVoice] [bit] NOT NULL,
  49. [UseGlobalTime] [bit] NOT NULL,
  50. [PricePerMeter] [int] NOT NULL,
  51. [TaxFree] [bit] NOT NULL,
  52. [AllowDirectTeleport] [bit] NOT NULL,
  53. [RedirectGridX] [int] NOT NULL,
  54. [RedirectGridY] [int] NOT NULL,
  55. [ParentEstateID] [int] NOT NULL,
  56. [SunPosition] [float] NOT NULL,
  57. [EstateSkipScripts] [bit] NOT NULL,
  58. [BillableFactor] [float] NOT NULL,
  59. [PublicAccess] [bit] NOT NULL,
  60. [AbuseEmail] [varchar](255) NOT NULL,
  61. [EstateOwner] [varchar](36) NOT NULL,
  62. [DenyMinors] [bit] NOT NULL,
  63. CONSTRAINT [PK_estate_settings] PRIMARY KEY CLUSTERED
  64. (
  65. [EstateID] ASC
  66. )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
  67. ) ON [PRIMARY];
  68. CREATE TABLE [dbo].[estate_map](
  69. [RegionID] [varchar](36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
  70. [EstateID] [int] NOT NULL,
  71. CONSTRAINT [PK_estate_map] PRIMARY KEY CLUSTERED
  72. (
  73. [RegionID] ASC
  74. )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
  75. ) ON [PRIMARY];
  76. COMMIT
  77. :VERSION 2
  78. BEGIN TRANSACTION
  79. ALTER TABLE dbo.estate_managers DROP CONSTRAINT PK_estate_managers
  80. CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
  81. (
  82. EstateID
  83. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  84. ALTER TABLE dbo.estate_groups DROP CONSTRAINT PK_estate_groups
  85. CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
  86. (
  87. EstateID
  88. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  89. ALTER TABLE dbo.estate_users DROP CONSTRAINT PK_estate_users
  90. CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
  91. (
  92. EstateID
  93. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  94. COMMIT
  95. :VERSION 3
  96. BEGIN TRANSACTION
  97. CREATE TABLE dbo.Tmp_estateban
  98. (
  99. EstateID int NOT NULL,
  100. bannedUUID varchar(36) NOT NULL,
  101. bannedIp varchar(16) NULL,
  102. bannedIpHostMask varchar(16) NULL,
  103. bannedNameMask varchar(64) NULL
  104. ) ON [PRIMARY]
  105. IF EXISTS(SELECT * FROM dbo.estateban)
  106. EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
  107. SELECT EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban')
  108. DROP TABLE dbo.estateban
  109. EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT'
  110. CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
  111. (
  112. EstateID
  113. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  114. COMMIT
  115. :VERSION 4
  116. BEGIN TRANSACTION
  117. CREATE TABLE dbo.Tmp_estate_managers
  118. (
  119. EstateID int NOT NULL,
  120. uuid uniqueidentifier NOT NULL
  121. ) ON [PRIMARY]
  122. IF EXISTS(SELECT * FROM dbo.estate_managers)
  123. EXEC('INSERT INTO dbo.Tmp_estate_managers (EstateID, uuid)
  124. SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_managers WITH (HOLDLOCK TABLOCKX)')
  125. DROP TABLE dbo.estate_managers
  126. EXECUTE sp_rename N'dbo.Tmp_estate_managers', N'estate_managers', 'OBJECT'
  127. CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
  128. (
  129. EstateID
  130. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  131. COMMIT
  132. :VERSION 5
  133. BEGIN TRANSACTION
  134. CREATE TABLE dbo.Tmp_estate_groups
  135. (
  136. EstateID int NOT NULL,
  137. uuid uniqueidentifier NOT NULL
  138. ) ON [PRIMARY]
  139. IF EXISTS(SELECT * FROM dbo.estate_groups)
  140. EXEC('INSERT INTO dbo.Tmp_estate_groups (EstateID, uuid)
  141. SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_groups WITH (HOLDLOCK TABLOCKX)')
  142. DROP TABLE dbo.estate_groups
  143. EXECUTE sp_rename N'dbo.Tmp_estate_groups', N'estate_groups', 'OBJECT'
  144. CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
  145. (
  146. EstateID
  147. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  148. COMMIT
  149. :VERSION 6
  150. BEGIN TRANSACTION
  151. CREATE TABLE dbo.Tmp_estate_users
  152. (
  153. EstateID int NOT NULL,
  154. uuid uniqueidentifier NOT NULL
  155. ) ON [PRIMARY]
  156. IF EXISTS(SELECT * FROM dbo.estate_users)
  157. EXEC('INSERT INTO dbo.Tmp_estate_users (EstateID, uuid)
  158. SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_users WITH (HOLDLOCK TABLOCKX)')
  159. DROP TABLE dbo.estate_users
  160. EXECUTE sp_rename N'dbo.Tmp_estate_users', N'estate_users', 'OBJECT'
  161. CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
  162. (
  163. EstateID
  164. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  165. COMMIT
  166. :VERSION 7
  167. BEGIN TRANSACTION
  168. CREATE TABLE dbo.Tmp_estateban
  169. (
  170. EstateID int NOT NULL,
  171. bannedUUID uniqueidentifier NOT NULL,
  172. bannedIp varchar(16) NULL,
  173. bannedIpHostMask varchar(16) NULL,
  174. bannedNameMask varchar(64) NULL
  175. ) ON [PRIMARY]
  176. IF EXISTS(SELECT * FROM dbo.estateban)
  177. EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
  178. SELECT EstateID, CONVERT(uniqueidentifier, bannedUUID), bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban WITH (HOLDLOCK TABLOCKX)')
  179. DROP TABLE dbo.estateban
  180. EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT'
  181. CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
  182. (
  183. EstateID
  184. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  185. COMMIT
  186. :VERSION 8
  187. BEGIN TRANSACTION
  188. CREATE TABLE dbo.Tmp_estate_settings
  189. (
  190. EstateID int NOT NULL IDENTITY (1, 100),
  191. EstateName varchar(64) NULL DEFAULT (NULL),
  192. AbuseEmailToEstateOwner bit NOT NULL,
  193. DenyAnonymous bit NOT NULL,
  194. ResetHomeOnTeleport bit NOT NULL,
  195. FixedSun bit NOT NULL,
  196. DenyTransacted bit NOT NULL,
  197. BlockDwell bit NOT NULL,
  198. DenyIdentified bit NOT NULL,
  199. AllowVoice bit NOT NULL,
  200. UseGlobalTime bit NOT NULL,
  201. PricePerMeter int NOT NULL,
  202. TaxFree bit NOT NULL,
  203. AllowDirectTeleport bit NOT NULL,
  204. RedirectGridX int NOT NULL,
  205. RedirectGridY int NOT NULL,
  206. ParentEstateID int NOT NULL,
  207. SunPosition float(53) NOT NULL,
  208. EstateSkipScripts bit NOT NULL,
  209. BillableFactor float(53) NOT NULL,
  210. PublicAccess bit NOT NULL,
  211. AbuseEmail varchar(255) NOT NULL,
  212. EstateOwner uniqueidentifier NOT NULL,
  213. DenyMinors bit NOT NULL
  214. ) ON [PRIMARY]
  215. SET IDENTITY_INSERT dbo.Tmp_estate_settings ON
  216. IF EXISTS(SELECT * FROM dbo.estate_settings)
  217. EXEC('INSERT INTO dbo.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)
  218. SELECT EstateID, EstateName, AbuseEmailToEstateOwner, DenyAnonymous, ResetHomeOnTeleport, FixedSun, DenyTransacted, BlockDwell, DenyIdentified, AllowVoice, UseGlobalTime, PricePerMeter, TaxFree, AllowDirectTeleport, RedirectGridX, RedirectGridY, ParentEstateID, SunPosition, EstateSkipScripts, BillableFactor, PublicAccess, AbuseEmail, CONVERT(uniqueidentifier, EstateOwner), DenyMinors FROM dbo.estate_settings WITH (HOLDLOCK TABLOCKX)')
  219. SET IDENTITY_INSERT dbo.Tmp_estate_settings OFF
  220. DROP TABLE dbo.estate_settings
  221. EXECUTE sp_rename N'dbo.Tmp_estate_settings', N'estate_settings', 'OBJECT'
  222. ALTER TABLE dbo.estate_settings ADD CONSTRAINT
  223. PK_estate_settings PRIMARY KEY CLUSTERED
  224. (
  225. EstateID
  226. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  227. COMMIT
  228. :VERSION 9
  229. BEGIN TRANSACTION
  230. CREATE TABLE dbo.Tmp_estate_map
  231. (
  232. RegionID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
  233. EstateID int NOT NULL
  234. ) ON [PRIMARY]
  235. IF EXISTS(SELECT * FROM dbo.estate_map)
  236. EXEC('INSERT INTO dbo.Tmp_estate_map (RegionID, EstateID)
  237. SELECT CONVERT(uniqueidentifier, RegionID), EstateID FROM dbo.estate_map WITH (HOLDLOCK TABLOCKX)')
  238. DROP TABLE dbo.estate_map
  239. EXECUTE sp_rename N'dbo.Tmp_estate_map', N'estate_map', 'OBJECT'
  240. ALTER TABLE dbo.estate_map ADD CONSTRAINT
  241. PK_estate_map PRIMARY KEY CLUSTERED
  242. (
  243. RegionID
  244. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  245. COMMIT