Playout failover queries cluster_nodes.last_seen_at to find healthy nodes for channel re-placement. Column missing from original cluster schema. Migration 031 adds column + backfills existing nodes to NOW(). Fixes scheduler error: column "last_seen_at" does not exist Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
10 lines
539 B
SQL
10 lines
539 B
SQL
-- Migration 031 — Add last_seen_at to cluster_nodes
|
|
--
|
|
-- Playout failover (routes/playout.js restartChannel) queries cluster_nodes.last_seen_at
|
|
-- to find healthy nodes for channel re-placement. Column was missing from original
|
|
-- cluster schema; heartbeat endpoint updates it via /cluster/heartbeat.
|
|
|
|
ALTER TABLE cluster_nodes ADD COLUMN IF NOT EXISTS last_seen_at TIMESTAMPTZ;
|
|
|
|
-- Backfill existing nodes to NOW() so they're immediately eligible for failover
|
|
UPDATE cluster_nodes SET last_seen_at = NOW() WHERE last_seen_at IS NULL;
|