-- Recreate Primary Key
ALTER TABLE auth.users ADD CONSTRAINT users_pkey PRIMARY KEY (id);

-- Recreate Unique Constraints
ALTER TABLE auth.users ADD CONSTRAINT users_phone_key UNIQUE (phone);
ALTER TABLE auth.users ADD CONSTRAINT users_email_partial_key UNIQUE (email) WHERE (is_sso_user = false);

-- Recreate Check Constraints
ALTER TABLE auth.users ADD CONSTRAINT users_email_change_confirm_status_check CHECK (
    (email_change_confirm_status >= 0) AND (email_change_confirm_status <= 2)
);