-- Auto-login credentials for daily Zerodha token refresh
ALTER TABLE user_broker
    ADD COLUMN IF NOT EXISTS zerodha_login_id   TEXT,
    ADD COLUMN IF NOT EXISTS zerodha_password    TEXT,
    ADD COLUMN IF NOT EXISTS totp_secret         TEXT,
    ADD COLUMN IF NOT EXISTS auto_login_enabled  BOOLEAN NOT NULL DEFAULT FALSE,
    ADD COLUMN IF NOT EXISTS auto_login_last_at  TIMESTAMPTZ,
    ADD COLUMN IF NOT EXISTS auto_login_last_err TEXT;
