UserStore.migrations 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. :VERSION 1
  2. CREATE TABLE [users] (
  3. [UUID] [varchar](36) NOT NULL default '',
  4. [username] [varchar](32) NOT NULL,
  5. [lastname] [varchar](32) NOT NULL,
  6. [passwordHash] [varchar](32) NOT NULL,
  7. [passwordSalt] [varchar](32) NOT NULL,
  8. [homeRegion] [bigint] default NULL,
  9. [homeLocationX] [float] default NULL,
  10. [homeLocationY] [float] default NULL,
  11. [homeLocationZ] [float] default NULL,
  12. [homeLookAtX] [float] default NULL,
  13. [homeLookAtY] [float] default NULL,
  14. [homeLookAtZ] [float] default NULL,
  15. [created] [int] NOT NULL,
  16. [lastLogin] [int] NOT NULL,
  17. [userInventoryURI] [varchar](255) default NULL,
  18. [userAssetURI] [varchar](255) default NULL,
  19. [profileCanDoMask] [int] default NULL,
  20. [profileWantDoMask] [int] default NULL,
  21. [profileAboutText] [ntext],
  22. [profileFirstText] [ntext],
  23. [profileImage] [varchar](36) default NULL,
  24. [profileFirstImage] [varchar](36) default NULL,
  25. [webLoginKey] [varchar](36) default NULL,
  26. PRIMARY KEY CLUSTERED
  27. (
  28. [UUID] ASC
  29. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  30. ) ON [PRIMARY]
  31. CREATE NONCLUSTERED INDEX [usernames] ON [users]
  32. (
  33. [username] ASC,
  34. [lastname] ASC
  35. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  36. CREATE TABLE [agents] (
  37. [UUID] [varchar](36) NOT NULL,
  38. [sessionID] [varchar](36) NOT NULL,
  39. [secureSessionID] [varchar](36) NOT NULL,
  40. [agentIP] [varchar](16) NOT NULL,
  41. [agentPort] [int] NOT NULL,
  42. [agentOnline] [tinyint] NOT NULL,
  43. [loginTime] [int] NOT NULL,
  44. [logoutTime] [int] NOT NULL,
  45. [currentRegion] [varchar](36) NOT NULL,
  46. [currentHandle] [bigint] NOT NULL,
  47. [currentPos] [varchar](64) NOT NULL,
  48. PRIMARY KEY CLUSTERED
  49. (
  50. [UUID] ASC
  51. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  52. ) ON [PRIMARY]
  53. CREATE NONCLUSTERED INDEX [session] ON [agents]
  54. (
  55. [sessionID] ASC
  56. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  57. CREATE NONCLUSTERED INDEX [ssession] ON [agents]
  58. (
  59. [secureSessionID] ASC
  60. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  61. CREATE TABLE [dbo].[userfriends](
  62. [ownerID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL,
  63. [friendID] [varchar](50) COLLATE Latin1_General_CI_AS NOT NULL,
  64. [friendPerms] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
  65. [datetimestamp] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
  66. ) ON [PRIMARY]
  67. CREATE TABLE [avatarappearance] (
  68. [Owner] [varchar](36) NOT NULL,
  69. [Serial] int NOT NULL,
  70. [Visual_Params] [image] NOT NULL,
  71. [Texture] [image] NOT NULL,
  72. [Avatar_Height] float NOT NULL,
  73. [Body_Item] [varchar](36) NOT NULL,
  74. [Body_Asset] [varchar](36) NOT NULL,
  75. [Skin_Item] [varchar](36) NOT NULL,
  76. [Skin_Asset] [varchar](36) NOT NULL,
  77. [Hair_Item] [varchar](36) NOT NULL,
  78. [Hair_Asset] [varchar](36) NOT NULL,
  79. [Eyes_Item] [varchar](36) NOT NULL,
  80. [Eyes_Asset] [varchar](36) NOT NULL,
  81. [Shirt_Item] [varchar](36) NOT NULL,
  82. [Shirt_Asset] [varchar](36) NOT NULL,
  83. [Pants_Item] [varchar](36) NOT NULL,
  84. [Pants_Asset] [varchar](36) NOT NULL,
  85. [Shoes_Item] [varchar](36) NOT NULL,
  86. [Shoes_Asset] [varchar](36) NOT NULL,
  87. [Socks_Item] [varchar](36) NOT NULL,
  88. [Socks_Asset] [varchar](36) NOT NULL,
  89. [Jacket_Item] [varchar](36) NOT NULL,
  90. [Jacket_Asset] [varchar](36) NOT NULL,
  91. [Gloves_Item] [varchar](36) NOT NULL,
  92. [Gloves_Asset] [varchar](36) NOT NULL,
  93. [Undershirt_Item] [varchar](36) NOT NULL,
  94. [Undershirt_Asset] [varchar](36) NOT NULL,
  95. [Underpants_Item] [varchar](36) NOT NULL,
  96. [Underpants_Asset] [varchar](36) NOT NULL,
  97. [Skirt_Item] [varchar](36) NOT NULL,
  98. [Skirt_Asset] [varchar](36) NOT NULL,
  99. PRIMARY KEY CLUSTERED (
  100. [Owner]
  101. ) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  102. ) ON [PRIMARY]
  103. :VERSION 2
  104. BEGIN TRANSACTION
  105. ALTER TABLE users ADD homeRegionID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000';
  106. ALTER TABLE users ADD userFlags int NOT NULL default 0;
  107. ALTER TABLE users ADD godLevel int NOT NULL default 0;
  108. ALTER TABLE users ADD customType varchar(32) not null default '';
  109. ALTER TABLE users ADD partner varchar(36) not null default '00000000-0000-0000-0000-000000000000';
  110. COMMIT
  111. :VERSION 3
  112. BEGIN TRANSACTION
  113. CREATE TABLE [avatarattachments] (
  114. [UUID] varchar(36) NOT NULL
  115. , [attachpoint] int NOT NULL
  116. , [item] varchar(36) NOT NULL
  117. , [asset] varchar(36) NOT NULL)
  118. CREATE NONCLUSTERED INDEX IX_avatarattachments ON dbo.avatarattachments
  119. (
  120. UUID
  121. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  122. COMMIT
  123. :VERSION 4
  124. BEGIN TRANSACTION
  125. CREATE TABLE Tmp_userfriends
  126. (
  127. ownerID varchar(36) NOT NULL,
  128. friendID varchar(36) NOT NULL,
  129. friendPerms int NOT NULL,
  130. datetimestamp int NOT NULL
  131. ) ON [PRIMARY]
  132. IF EXISTS(SELECT * FROM userfriends)
  133. EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
  134. SELECT CONVERT(varchar(36), ownerID), CONVERT(varchar(36), friendID), CONVERT(int, friendPerms), CONVERT(int, datetimestamp) FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
  135. DROP TABLE dbo.userfriends
  136. EXECUTE sp_rename N'Tmp_userfriends', N'userfriends', 'OBJECT'
  137. CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON userfriends
  138. (
  139. ownerID
  140. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  141. CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON userfriends
  142. (
  143. friendID
  144. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  145. COMMIT
  146. :VERSION 5
  147. BEGIN TRANSACTION
  148. ALTER TABLE users add email varchar(250);
  149. COMMIT
  150. :VERSION 6
  151. BEGIN TRANSACTION
  152. CREATE TABLE dbo.Tmp_users
  153. (
  154. UUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
  155. username varchar(32) NOT NULL,
  156. lastname varchar(32) NOT NULL,
  157. passwordHash varchar(32) NOT NULL,
  158. passwordSalt varchar(32) NOT NULL,
  159. homeRegion bigint NULL DEFAULT (NULL),
  160. homeLocationX float(53) NULL DEFAULT (NULL),
  161. homeLocationY float(53) NULL DEFAULT (NULL),
  162. homeLocationZ float(53) NULL DEFAULT (NULL),
  163. homeLookAtX float(53) NULL DEFAULT (NULL),
  164. homeLookAtY float(53) NULL DEFAULT (NULL),
  165. homeLookAtZ float(53) NULL DEFAULT (NULL),
  166. created int NOT NULL,
  167. lastLogin int NOT NULL,
  168. userInventoryURI varchar(255) NULL DEFAULT (NULL),
  169. userAssetURI varchar(255) NULL DEFAULT (NULL),
  170. profileCanDoMask int NULL DEFAULT (NULL),
  171. profileWantDoMask int NULL DEFAULT (NULL),
  172. profileAboutText ntext NULL,
  173. profileFirstText ntext NULL,
  174. profileImage uniqueidentifier NULL DEFAULT (NULL),
  175. profileFirstImage uniqueidentifier NULL DEFAULT (NULL),
  176. webLoginKey uniqueidentifier NULL DEFAULT (NULL),
  177. homeRegionID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
  178. userFlags int NOT NULL DEFAULT ((0)),
  179. godLevel int NOT NULL DEFAULT ((0)),
  180. customType varchar(32) NOT NULL DEFAULT (''),
  181. partner uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
  182. email varchar(250) NULL
  183. ) ON [PRIMARY]
  184. TEXTIMAGE_ON [PRIMARY]
  185. IF EXISTS(SELECT * FROM dbo.users)
  186. EXEC('INSERT INTO dbo.Tmp_users (UUID, username, lastname, passwordHash, passwordSalt, homeRegion, homeLocationX, homeLocationY, homeLocationZ, homeLookAtX, homeLookAtY, homeLookAtZ, created, lastLogin, userInventoryURI, userAssetURI, profileCanDoMask, profileWantDoMask, profileAboutText, profileFirstText, profileImage, profileFirstImage, webLoginKey, homeRegionID, userFlags, godLevel, customType, partner, email)
  187. SELECT CONVERT(uniqueidentifier, UUID), username, lastname, passwordHash, passwordSalt, homeRegion, homeLocationX, homeLocationY, homeLocationZ, homeLookAtX, homeLookAtY, homeLookAtZ, created, lastLogin, userInventoryURI, userAssetURI, profileCanDoMask, profileWantDoMask, profileAboutText, profileFirstText, CONVERT(uniqueidentifier, profileImage), CONVERT(uniqueidentifier, profileFirstImage), CONVERT(uniqueidentifier, webLoginKey), CONVERT(uniqueidentifier, homeRegionID), userFlags, godLevel, customType, CONVERT(uniqueidentifier, partner), email FROM dbo.users WITH (HOLDLOCK TABLOCKX)')
  188. DROP TABLE dbo.users
  189. EXECUTE sp_rename N'dbo.Tmp_users', N'users', 'OBJECT'
  190. ALTER TABLE dbo.users ADD CONSTRAINT
  191. PK__users__65A475E737A5467C PRIMARY KEY CLUSTERED
  192. (
  193. UUID
  194. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  195. CREATE NONCLUSTERED INDEX usernames ON dbo.users
  196. (
  197. username,
  198. lastname
  199. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  200. COMMIT
  201. :VERSION 7
  202. BEGIN TRANSACTION
  203. CREATE TABLE dbo.Tmp_agents
  204. (
  205. UUID uniqueidentifier NOT NULL,
  206. sessionID uniqueidentifier NOT NULL,
  207. secureSessionID uniqueidentifier NOT NULL,
  208. agentIP varchar(16) NOT NULL,
  209. agentPort int NOT NULL,
  210. agentOnline tinyint NOT NULL,
  211. loginTime int NOT NULL,
  212. logoutTime int NOT NULL,
  213. currentRegion uniqueidentifier NOT NULL,
  214. currentHandle bigint NOT NULL,
  215. currentPos varchar(64) NOT NULL
  216. ) ON [PRIMARY]
  217. IF EXISTS(SELECT * FROM dbo.agents)
  218. EXEC('INSERT INTO dbo.Tmp_agents (UUID, sessionID, secureSessionID, agentIP, agentPort, agentOnline, loginTime, logoutTime, currentRegion, currentHandle, currentPos)
  219. SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, sessionID), CONVERT(uniqueidentifier, secureSessionID), agentIP, agentPort, agentOnline, loginTime, logoutTime, CONVERT(uniqueidentifier, currentRegion), currentHandle, currentPos FROM dbo.agents WITH (HOLDLOCK TABLOCKX)')
  220. DROP TABLE dbo.agents
  221. EXECUTE sp_rename N'dbo.Tmp_agents', N'agents', 'OBJECT'
  222. ALTER TABLE dbo.agents ADD CONSTRAINT
  223. PK__agents__65A475E749C3F6B7 PRIMARY KEY CLUSTERED
  224. (
  225. UUID
  226. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  227. CREATE NONCLUSTERED INDEX session ON dbo.agents
  228. (
  229. sessionID
  230. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  231. CREATE NONCLUSTERED INDEX ssession ON dbo.agents
  232. (
  233. secureSessionID
  234. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  235. COMMIT
  236. :VERSION 8
  237. BEGIN TRANSACTION
  238. CREATE TABLE dbo.Tmp_userfriends
  239. (
  240. ownerID uniqueidentifier NOT NULL,
  241. friendID uniqueidentifier NOT NULL,
  242. friendPerms int NOT NULL,
  243. datetimestamp int NOT NULL
  244. ) ON [PRIMARY]
  245. IF EXISTS(SELECT * FROM dbo.userfriends)
  246. EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
  247. SELECT CONVERT(uniqueidentifier, ownerID), CONVERT(uniqueidentifier, friendID), friendPerms, datetimestamp FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
  248. DROP TABLE dbo.userfriends
  249. EXECUTE sp_rename N'dbo.Tmp_userfriends', N'userfriends', 'OBJECT'
  250. CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON dbo.userfriends
  251. (
  252. ownerID
  253. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  254. CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON dbo.userfriends
  255. (
  256. friendID
  257. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  258. COMMIT
  259. :VERSION 9
  260. BEGIN TRANSACTION
  261. CREATE TABLE dbo.Tmp_avatarappearance
  262. (
  263. Owner uniqueidentifier NOT NULL,
  264. Serial int NOT NULL,
  265. Visual_Params image NOT NULL,
  266. Texture image NOT NULL,
  267. Avatar_Height float(53) NOT NULL,
  268. Body_Item uniqueidentifier NOT NULL,
  269. Body_Asset uniqueidentifier NOT NULL,
  270. Skin_Item uniqueidentifier NOT NULL,
  271. Skin_Asset uniqueidentifier NOT NULL,
  272. Hair_Item uniqueidentifier NOT NULL,
  273. Hair_Asset uniqueidentifier NOT NULL,
  274. Eyes_Item uniqueidentifier NOT NULL,
  275. Eyes_Asset uniqueidentifier NOT NULL,
  276. Shirt_Item uniqueidentifier NOT NULL,
  277. Shirt_Asset uniqueidentifier NOT NULL,
  278. Pants_Item uniqueidentifier NOT NULL,
  279. Pants_Asset uniqueidentifier NOT NULL,
  280. Shoes_Item uniqueidentifier NOT NULL,
  281. Shoes_Asset uniqueidentifier NOT NULL,
  282. Socks_Item uniqueidentifier NOT NULL,
  283. Socks_Asset uniqueidentifier NOT NULL,
  284. Jacket_Item uniqueidentifier NOT NULL,
  285. Jacket_Asset uniqueidentifier NOT NULL,
  286. Gloves_Item uniqueidentifier NOT NULL,
  287. Gloves_Asset uniqueidentifier NOT NULL,
  288. Undershirt_Item uniqueidentifier NOT NULL,
  289. Undershirt_Asset uniqueidentifier NOT NULL,
  290. Underpants_Item uniqueidentifier NOT NULL,
  291. Underpants_Asset uniqueidentifier NOT NULL,
  292. Skirt_Item uniqueidentifier NOT NULL,
  293. Skirt_Asset uniqueidentifier NOT NULL
  294. ) ON [PRIMARY]
  295. TEXTIMAGE_ON [PRIMARY]
  296. IF EXISTS(SELECT * FROM dbo.avatarappearance)
  297. EXEC('INSERT INTO dbo.Tmp_avatarappearance (Owner, Serial, Visual_Params, Texture, Avatar_Height, Body_Item, Body_Asset, Skin_Item, Skin_Asset, Hair_Item, Hair_Asset, Eyes_Item, Eyes_Asset, Shirt_Item, Shirt_Asset, Pants_Item, Pants_Asset, Shoes_Item, Shoes_Asset, Socks_Item, Socks_Asset, Jacket_Item, Jacket_Asset, Gloves_Item, Gloves_Asset, Undershirt_Item, Undershirt_Asset, Underpants_Item, Underpants_Asset, Skirt_Item, Skirt_Asset)
  298. SELECT CONVERT(uniqueidentifier, Owner), Serial, Visual_Params, Texture, Avatar_Height, CONVERT(uniqueidentifier, Body_Item), CONVERT(uniqueidentifier, Body_Asset), CONVERT(uniqueidentifier, Skin_Item), CONVERT(uniqueidentifier, Skin_Asset), CONVERT(uniqueidentifier, Hair_Item), CONVERT(uniqueidentifier, Hair_Asset), CONVERT(uniqueidentifier, Eyes_Item), CONVERT(uniqueidentifier, Eyes_Asset), CONVERT(uniqueidentifier, Shirt_Item), CONVERT(uniqueidentifier, Shirt_Asset), CONVERT(uniqueidentifier, Pants_Item), CONVERT(uniqueidentifier, Pants_Asset), CONVERT(uniqueidentifier, Shoes_Item), CONVERT(uniqueidentifier, Shoes_Asset), CONVERT(uniqueidentifier, Socks_Item), CONVERT(uniqueidentifier, Socks_Asset), CONVERT(uniqueidentifier, Jacket_Item), CONVERT(uniqueidentifier, Jacket_Asset), CONVERT(uniqueidentifier, Gloves_Item), CONVERT(uniqueidentifier, Gloves_Asset), CONVERT(uniqueidentifier, Undershirt_Item), CONVERT(uniqueidentifier, Undershirt_Asset), CONVERT(uniqueidentifier, Underpants_Item), CONVERT(uniqueidentifier, Underpants_Asset), CONVERT(uniqueidentifier, Skirt_Item), CONVERT(uniqueidentifier, Skirt_Asset) FROM dbo.avatarappearance WITH (HOLDLOCK TABLOCKX)')
  299. DROP TABLE dbo.avatarappearance
  300. EXECUTE sp_rename N'dbo.Tmp_avatarappearance', N'avatarappearance', 'OBJECT'
  301. ALTER TABLE dbo.avatarappearance ADD CONSTRAINT
  302. PK__avatarap__7DD115CC4E88ABD4 PRIMARY KEY CLUSTERED
  303. (
  304. Owner
  305. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  306. COMMIT
  307. :VERSION 10
  308. BEGIN TRANSACTION
  309. CREATE TABLE dbo.Tmp_avatarattachments
  310. (
  311. UUID uniqueidentifier NOT NULL,
  312. attachpoint int NOT NULL,
  313. item uniqueidentifier NOT NULL,
  314. asset uniqueidentifier NOT NULL
  315. ) ON [PRIMARY]
  316. IF EXISTS(SELECT * FROM dbo.avatarattachments)
  317. EXEC('INSERT INTO dbo.Tmp_avatarattachments (UUID, attachpoint, item, asset)
  318. SELECT CONVERT(uniqueidentifier, UUID), attachpoint, CONVERT(uniqueidentifier, item), CONVERT(uniqueidentifier, asset) FROM dbo.avatarattachments WITH (HOLDLOCK TABLOCKX)')
  319. DROP TABLE dbo.avatarattachments
  320. EXECUTE sp_rename N'dbo.Tmp_avatarattachments', N'avatarattachments', 'OBJECT'
  321. CREATE NONCLUSTERED INDEX IX_avatarattachments ON dbo.avatarattachments
  322. (
  323. UUID
  324. ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  325. COMMIT
  326. :VERSION 11
  327. BEGIN TRANSACTION
  328. ALTER TABLE users ADD scopeID uniqueidentifier not null default '00000000-0000-0000-0000-000000000000'
  329. COMMIT