gitdataai/lib/migrate/sql/agent/agent_hook_registration_up_01.sql
2026-05-30 01:38:40 +08:00

14 lines
507 B
SQL

CREATE TABLE IF NOT EXISTS agent_hook_registration (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
session_id UUID NOT NULL REFERENCES agent_session(id) ON DELETE CASCADE,
hook_type TEXT NOT NULL,
handler_name TEXT NOT NULL,
config_json TEXT,
priority INTEGER NOT NULL DEFAULT 0,
enabled BOOLEAN NOT NULL DEFAULT true,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX IF NOT EXISTS idx_agent_hook_session
ON agent_hook_registration(session_id, hook_type);