AuthStore.migrations 820 B

12345678910111213141516171819202122232425262728
  1. :VERSION 1
  2. BEGIN TRANSACTION
  3. CREATE TABLE [auth] (
  4. [uuid] [uniqueidentifier] NOT NULL default '00000000-0000-0000-0000-000000000000',
  5. [passwordHash] [varchar](32) NOT NULL,
  6. [passwordSalt] [varchar](32) NOT NULL,
  7. [webLoginKey] [varchar](255) NOT NULL,
  8. [accountType] VARCHAR(32) NOT NULL DEFAULT 'UserAccount',
  9. ) ON [PRIMARY]
  10. CREATE TABLE [tokens] (
  11. [uuid] [uniqueidentifier] NOT NULL default '00000000-0000-0000-0000-000000000000',
  12. [token] [varchar](255) NOT NULL,
  13. [validity] [datetime] NOT NULL )
  14. ON [PRIMARY]
  15. COMMIT
  16. :VERSION 2
  17. BEGIN TRANSACTION
  18. INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey, accountType) SELECT [UUID] AS UUID, [passwordHash] AS passwordHash, [passwordSalt] AS passwordSalt, [webLoginKey] AS webLoginKey, 'UserAccount' as [accountType] FROM users;
  19. COMMIT