fix for phone generation on email signup
This commit is contained in:
parent
cee960fea0
commit
3409f190b9
20 changed files with 457 additions and 54 deletions
2
deploy/migrations/0088_users_signup_email.down.sql
Normal file
2
deploy/migrations/0088_users_signup_email.down.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
DROP INDEX IF EXISTS users_signup_email_lower_unique_idx;
|
||||
ALTER TABLE public.users DROP COLUMN signup_email;
|
||||
13
deploy/migrations/0088_users_signup_email.up.sql
Normal file
13
deploy/migrations/0088_users_signup_email.up.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
-- Email-signup accounts (see internal/domain.EncodeEmailPhone) now get a
|
||||
-- short, normal-looking random "888" phone number in users.phone instead of
|
||||
-- storing the email-derived string there directly (that string only ever
|
||||
-- travels on the wire during auth.sendCode/signIn/signUp, exactly like a real
|
||||
-- phone number would). signup_email is the durable email->user reverse
|
||||
-- lookup that replaces the old "phone IS the email encoding" identity: it is
|
||||
-- what SendCode/SignIn use to find a returning email-signup account by the
|
||||
-- (deterministic) wire value decoded back to an email.
|
||||
ALTER TABLE public.users ADD COLUMN signup_email character varying(200) NOT NULL DEFAULT '';
|
||||
|
||||
-- Case-insensitive, ignores the empty default so real phone-number accounts
|
||||
-- (the overwhelming majority) never touch this index.
|
||||
CREATE UNIQUE INDEX users_signup_email_lower_unique_idx ON public.users (lower(signup_email)) WHERE signup_email <> '';
|
||||
Loading…
Add table
Add a link
Reference in a new issue