-- Preserve enough ActivityPub Note metadata for remote cached statuses to
-- render accurately and avoid exposing non-public deliveries.

ALTER TABLE cached_statuses ADD COLUMN visibility TEXT NOT NULL DEFAULT 'public';
ALTER TABLE cached_statuses ADD COLUMN mentions_json TEXT NOT NULL DEFAULT '[]';
ALTER TABLE cached_statuses ADD COLUMN tags_json TEXT NOT NULL DEFAULT '[]';
ALTER TABLE cached_statuses ADD COLUMN local_recipients_json TEXT NOT NULL DEFAULT '[]';

CREATE INDEX IF NOT EXISTS idx_cached_statuses_visibility_time ON cached_statuses(visibility, published DESC);
