GridUserStore.migrations 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. :VERSION 1 # --------------------------
  2. BEGIN TRANSACTION;
  3. CREATE TABLE GridUser (
  4. "UserID" VARCHAR(255) NOT NULL Primary Key,
  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. ) ;
  15. COMMIT;
  16. :VERSION 2 # --------------------------
  17. BEGIN TRANSACTION;
  18. CREATE TABLE GridUser_tmp (
  19. "UserID" VARCHAR(255) NOT NULL PRIMARY KEY,
  20. "HomeRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  21. "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  22. "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  23. "LastRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  24. "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  25. "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
  26. "Online" CHAR(5) NOT NULL DEFAULT 'false',
  27. "Login" CHAR(16) NOT NULL DEFAULT '0',
  28. "Logout" CHAR(16) NOT NULL DEFAULT '0'
  29. );
  30. COMMIT;
  31. INSERT INTO GridUser_tmp ("UserID"
  32. ,"HomeRegionID"
  33. ,"HomePosition"
  34. ,"HomeLookAt"
  35. ,"LastRegionID"
  36. ,"LastPosition"
  37. ,"LastLookAt"
  38. ,"Online"
  39. ,"Login"
  40. ,"Logout")
  41. SELECT "UserID", cast("HomeRegionID" as uuid), "HomePosition" ,"HomeLookAt" , cast("LastRegionID" as uuid),
  42. "LastPosition"
  43. ,"LastLookAt"
  44. ,"Online"
  45. ,"Login"
  46. ,"Logout" FROM GridUser;
  47. DROP TABLE GridUser;
  48. alter table GridUser_tmp rename to GridUser;