-- The player's field notebook: lines captured from NPCs during play, per playthrough.
-- A page can later be torn onto the board as a note exhibit.
CREATE TABLE osint.notebook_pages (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  playthrough_id UUID NOT NULL REFERENCES osint.playthroughs(id) ON DELETE CASCADE,
  text TEXT NOT NULL,
  source_utterance_id UUID REFERENCES osint.utterances(id) ON DELETE SET NULL,
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX notebook_pages_playthrough_idx ON osint.notebook_pages (playthrough_id, created_at);
