panel v0.9.1 — open-source game server manager

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-14 23:25:11 -07:00
commit 03a281d009
2161 changed files with 300880 additions and 0 deletions
@@ -0,0 +1,20 @@
-- 004_event_triggers.sql — event-driven schedule triggers.
--
-- Until now schedules only supported cron. This migration adds:
-- * trigger_kind = 'event' schedules, powered by a CEL expression over
-- the event bus. Example: players_online == 0
-- * optional sustained-state: fire only after the condition has been
-- continuously true for N seconds. Enables "idle shutdown if 0 players
-- for 30m" without firing every 60s when the polled player count is 0.
--
-- cron_spec becomes nullable so event triggers can exist with NULL there.
-- Exactly one of cron_spec / event_spec is populated; the application
-- enforces this.
ALTER TABLE schedules ALTER COLUMN cron_spec DROP NOT NULL;
ALTER TABLE schedules
ADD COLUMN event_spec TEXT,
ADD COLUMN event_sustained_seconds INTEGER NOT NULL DEFAULT 0;
CREATE INDEX idx_schedules_trigger_kind ON schedules(trigger_kind);