Skip to content
Myr

0006_account_email.sql

This file

Path

apps/platform/migrations/0006_account_email.sql

11 lines · 703 bytes · SQL

Last changed by

Sign people in by a proven email, with a display name, and Google's emailoscabrielbefore adoption125964c

History of this file

Take it

1-- An account's email and display name. `email` is always one whose owner2-- proved it: sign-up writes the account only after the code mailed to it3-- came back, and Google's address only when Google says it verified it.4-- `email_key` is the address lowercased, so two spellings are one address5-- and a racing second sign-up fails on the index. Accounts made before this6-- migration have neither until their person adds an email at sign-in; a7-- unique index lets any number of rows hold NULL.8ALTER TABLE accounts ADD COLUMN email TEXT;9ALTER TABLE accounts ADD COLUMN email_key TEXT;10ALTER TABLE accounts ADD COLUMN display_name TEXT;11CREATE UNIQUE INDEX accounts_by_email ON accounts (email_key);