GridUserStore.migrations 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. :VERSION 1 # --------------------------
  2. BEGIN TRANSACTION
  3. CREATE TABLE "GridUser" (
  4. "UserID" VARCHAR(255) NOT NULL,
  5. "HomeRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  6. "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  7. "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  8. "LastRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  9. "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  10. "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  11. "Online" CHAR(5) NOT NULL DEFAULT 'false',
  12. "Login" CHAR(16) NOT NULL DEFAULT '0',
  13. "Logout" CHAR(16) NOT NULL DEFAULT '0',
  14. PRIMARY KEY ("UserID")
  15. )
  16. COMMIT
  17. :VERSION 2 # --------------------------
  18. BEGIN TRANSACTION
  19. CREATE TABLE [GridUser_tmp] (
  20. [UserID] VARCHAR(255) NOT NULL,
  21. [HomeRegionID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  22. [HomePosition] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  23. [HomeLookAt] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  24. [LastRegionID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  25. [LastPosition] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  26. [LastLookAt] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  27. [Online] CHAR(5) NOT NULL DEFAULT 'false',
  28. [Login] CHAR(16) NOT NULL DEFAULT '0',
  29. [Logout] CHAR(16) NOT NULL DEFAULT '0',
  30. PRIMARY KEY CLUSTERED
  31. (
  32. [UserID] ASC
  33. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  34. ) ON [PRIMARY]
  35. COMMIT
  36. IF EXISTS(SELECT * FROM dbo.GridUser)
  37. EXEC('INSERT INTO dbo.GridUser_tmp ([UserID]
  38. ,[HomeRegionID]
  39. ,[HomePosition]
  40. ,[HomeLookAt]
  41. ,[LastRegionID]
  42. ,[LastPosition]
  43. ,[LastLookAt]
  44. ,[Online]
  45. ,[Login]
  46. ,[Logout])
  47. SELECT CONVERT(varchar(36), [HomeRegionID]), [HomePosition] ,[HomeLookAt] , CONVERT(varchar(36),[LastRegionID])
  48. ,[LastPosition]
  49. ,[LastLookAt]
  50. ,[Online]
  51. ,[Login]
  52. ,[Logout] FROM dbo.GridUser WITH (HOLDLOCK TABLOCKX)')
  53. DROP TABLE dbo.GridUser
  54. EXECUTE sp_rename N'dbo.GridUser_tmp', N'GridUser', 'OBJECT'