1
0

Presence.migrations 835 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. :VERSION 1
  2. BEGIN TRANSACTION;
  3. CREATE TABLE Presence (
  4. "UserID" varchar(255) NOT NULL,
  5. "RegionID" uuid NOT NULL,
  6. "SessionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
  7. "SecureSessionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
  8. );
  9. COMMIT;
  10. :VERSION 2
  11. BEGIN TRANSACTION;
  12. CREATE UNIQUE INDEX SessionID ON Presence("SessionID");
  13. CREATE INDEX UserID ON Presence("UserID");
  14. ALTER TABLE Presence ADD "LastSeen" Timestamp;
  15. COMMIT;
  16. :VERSION 3 # --------------------------
  17. BEGIN;
  18. CREATE INDEX RegionID ON Presence("RegionID");
  19. COMMIT;
  20. :VERSION 4 # Making sure LastSeen is actually defined in the table as it most likely erred in the double version 2 migration above
  21. BEGIN;
  22. ALTER TABLE Presence
  23. DROP COLUMN IF EXISTS "LastSeen",
  24. ADD COLUMN "LastSeen" Timestamp;
  25. COMMIT;