neon-sprawl/server/db/migrations/V009__player_faction_standi...

11 lines
478 B
SQL

-- NEO-135: per-player faction standing snapshots.
CREATE TABLE IF NOT EXISTS player_faction_standing (
player_id TEXT NOT NULL REFERENCES player_position(player_id) ON DELETE CASCADE,
faction_id TEXT NOT NULL,
standing INTEGER NOT NULL,
updated_at TIMESTAMPTZ NOT NULL DEFAULT now(),
PRIMARY KEY (player_id, faction_id)
);
COMMENT ON TABLE player_faction_standing IS 'Persisted faction standing per player (NEO-135); missing row means neutral 0 at read.';