-- +goose Up
CREATE TABLE IF NOT EXISTS request_token_usage (
    id SERIAL PRIMARY KEY,
    request_id UUID NOT NULL REFERENCES requests_for_suppliers(id) ON DELETE CASCADE,
    request_token_count INT DEFAULT 0,
    response_token_count INT DEFAULT 0,
    token_cost NUMERIC(10, 5) DEFAULT 0.0,
    type TEXT NOT NULL,
    created_at TIMESTAMP DEFAULT now()
);

CREATE INDEX IF NOT EXISTS idx_token_usage_request_id ON request_token_usage(request_id);

-- +goose Down
DROP TABLE request_token_usage;
