1
0

UserAccount.migrations 891 B

1234567891011121314151617181920212223242526272829303132333435
  1. :VERSION 1
  2. BEGIN TRANSACTION;
  3. -- useraccounts table
  4. CREATE TABLE UserAccounts (
  5. PrincipalID CHAR(36) primary key,
  6. ScopeID CHAR(36) NOT NULL,
  7. FirstName VARCHAR(64) NOT NULL,
  8. LastName VARCHAR(64) NOT NULL,
  9. Email VARCHAR(64),
  10. ServiceURLs TEXT,
  11. Created INT(11),
  12. UserLevel integer NOT NULL DEFAULT 0,
  13. UserFlags integer NOT NULL DEFAULT 0,
  14. UserTitle varchar(64) NOT NULL DEFAULT ''
  15. );
  16. COMMIT;
  17. :VERSION 2
  18. BEGIN TRANSACTION;
  19. INSERT INTO UserAccounts (PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created) SELECT `UUID` AS PrincipalID, '00000000-0000-0000-0000-000000000000' AS ScopeID, username AS FirstName, surname AS LastName, '' as Email, '' AS ServiceURLs, created as Created FROM users;
  20. COMMIT;
  21. :VERSION 3 # -------------------------
  22. BEGIN;
  23. ALTER TABLE `UserAccounts` ADD `active` BOOLEAN NOT NULL DEFAULT TRUE;
  24. COMMIT;