verstak/internal/core/storage/migrations_005.sql.go

22 lines
593 B
Go

package storage
// migration005 — actions table for runnable actions attached to nodes.
const migration005 = `
CREATE TABLE IF NOT EXISTS actions (
id TEXT PRIMARY KEY,
node_id TEXT NOT NULL REFERENCES nodes(id),
title TEXT NOT NULL,
kind TEXT NOT NULL,
command TEXT NULL,
args_json TEXT NULL,
working_dir TEXT NULL,
url TEXT NULL,
confirm_required INTEGER NOT NULL DEFAULT 0,
capture_output INTEGER NOT NULL DEFAULT 0,
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_actions_node ON actions(node_id);
`