-- Phone book + phone directory nodes. NPCs gain contact details; a phone node's
-- terminals each bind to an NPC (the callee) whose number the player dials.

ALTER TABLE osint.npcs ADD COLUMN phone_number TEXT;
ALTER TABLE osint.npcs ADD COLUMN email TEXT;

ALTER TABLE osint.story_nodes DROP CONSTRAINT story_nodes_node_type_check;
ALTER TABLE osint.story_nodes ADD CONSTRAINT story_nodes_node_type_check
  CHECK (node_type IN ('cutscene','dialogue','level','det_gate','llm_gate','merit','phone'));

-- A terminal on a phone node binds to the NPC you reach by dialing their number.
ALTER TABLE osint.story_node_terminals ADD COLUMN npc_id UUID REFERENCES osint.npcs(id) ON DELETE SET NULL;
