-- TTL cache for RIPEstat announced-prefixes per ASN (pipeline ingest).
CREATE TABLE asn_prefix_cache (
    asn           BIGINT PRIMARY KEY,
    holder        TEXT NOT NULL DEFAULT '',
    prefixes_json JSONB NOT NULL DEFAULT '[]',
    fetched_at    TIMESTAMPTZ NOT NULL DEFAULT now()
);

CREATE INDEX idx_asn_prefix_cache_fetched ON asn_prefix_cache (fetched_at);
