BEGIN;

ALTER TABLE refresh_tokens
    ADD COLUMN IF NOT EXISTS token_fingerprint VARCHAR(64);

CREATE UNIQUE INDEX IF NOT EXISTS idx_refresh_tokens_token_fingerprint
    ON refresh_tokens(token_fingerprint)
    WHERE token_fingerprint IS NOT NULL;

COMMIT;

