1
0

UserAccount.migrations 762 B

123456789101112131415161718192021222324252627
  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;