def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute("INSERT INTO auth_type VALUES ('webauthn_auth')")

    op.drop_constraint('ck_users_mobile_or_email_auth', 'users', type_=None, schema=None)
    op.execute("""
        ALTER TABLE users ADD CONSTRAINT "ck_user_has_mobile_or_other_auth"
        CHECK (auth_type in ('email_auth', 'webauthn_auth') or mobile_number is not null)
        NOT VALID
    """)
    # ### end Alembic commands ###