Extracted from uncaged monorepo (oc-xiaoju/uncaged). Resolves oc-xiaoju/uncaged#224. - @uncaged/ograph: CF Worker engine (events, projections, reactions) - @uncaged/ograph-cli: CLI for managing OGraph instances - Removed @uncaged/oid dependency (unused) - 116 tests, all passing - CI: GitHub Actions 小橘 🍊(NEKO Team)
18 lines
812 B
SQL
18 lines
812 B
SQL
-- Add action type support to reactions (Phase 2: emit_event)
|
|
-- Pre-launch: drop and recreate reactions table
|
|
|
|
DROP TABLE IF EXISTS reactions;
|
|
|
|
CREATE TABLE reactions (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
projection_def_hash TEXT NOT NULL REFERENCES projection_def_versions(hash),
|
|
params_hash TEXT NOT NULL,
|
|
params TEXT NOT NULL,
|
|
action TEXT NOT NULL DEFAULT 'webhook', -- 'webhook' | 'emit_event'
|
|
webhook_url TEXT, -- required when action = 'webhook'
|
|
emit_event_type TEXT, -- required when action = 'emit_event'
|
|
emit_payload_template TEXT, -- JSONata: optional template for emit_event
|
|
created_at INTEGER NOT NULL DEFAULT (unixepoch() * 1000)
|
|
);
|
|
CREATE INDEX idx_reactions_projection ON reactions(projection_def_hash, params_hash);
|