Saga State Schema
CREATE TABLE sagas (
id TEXT PRIMARY KEY,
state TEXT NOT NULL,
input JSON NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE saga_steps (
saga_id TEXT NOT NULL REFERENCES sagas(id),
step_name TEXT NOT NULL,
state TEXT NOT NULL,
output JSON,
error TEXT,
PRIMARY KEY (saga_id, step_name)
);