BEGIN; CREATE TABLE customer_phone_credential ( phone_digest char(64) PRIMARY KEY, phone_masked text NOT NULL, issuer text NOT NULL, subject text NOT NULL, password_hash text, created_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now(), UNIQUE(issuer,subject) ); ALTER TABLE onboarding_account_session ADD COLUMN phone_digest char(64) REFERENCES customer_phone_credential(phone_digest); ALTER TABLE onboarding_account_session ADD COLUMN phone_verified_at timestamptz; COMMIT;