Files
Assistant/database/migrations/005_commit_actions.sql
2026-08-16 15:22:49 +03:00

7 lines
481 B
PL/PgSQL

BEGIN;
SET ROLE commit_role;
CREATE TABLE IF NOT EXISTS commit.authorized_actions (authorized_action_id TEXT PRIMARY KEY, action_intent_id TEXT NOT NULL, state TEXT NOT NULL, revision BIGINT NOT NULL, CHECK (revision > 0));
CREATE TABLE IF NOT EXISTS commit.action_attempts (action_attempt_id TEXT PRIMARY KEY, authorized_action_id TEXT NOT NULL, action_intent_id TEXT NOT NULL, state TEXT NOT NULL, recorded_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP);
RESET ROLE;
COMMIT;