AuthStore.migrations 661 B

1234567891011121314151617181920212223242526272829
  1. :VERSION 1
  2. BEGIN TRANSACTION;
  3. CREATE TABLE auth (
  4. UUID char(36) NOT NULL,
  5. passwordHash char(32) NOT NULL default '',
  6. passwordSalt char(32) NOT NULL default '',
  7. webLoginKey varchar(255) NOT NULL default '',
  8. accountType VARCHAR(32) NOT NULL DEFAULT 'UserAccount',
  9. PRIMARY KEY (`UUID`)
  10. );
  11. CREATE TABLE tokens (
  12. UUID char(36) NOT NULL,
  13. token varchar(255) NOT NULL,
  14. validity datetime NOT NULL
  15. );
  16. COMMIT;
  17. :VERSION 2
  18. BEGIN TRANSACTION;
  19. INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey) SELECT `UUID` AS UUID, `passwordHash` AS passwordHash, `passwordSalt` AS passwordSalt, `webLoginKey` AS webLoginKey FROM users;
  20. COMMIT;