orchestration_session_state

Column Type PK Required Default
orchestration_session_state_id VARCHAR Yes Yes
session_id VARCHAR No Yes
session_entry_id VARCHAR No No
from_state TEXT No Yes
to_state TEXT No Yes
transition_result TEXT No No
transition_reason TEXT No No
transitioned_at TIMESTAMPTZ No No CURRENT_TIMESTAMP
elaboration TEXT No No

Foreign Keys

Column Name Foreign Key
session_entry_id session_entry_id references orchestration_session_entry.orchestration_session_entry_id
session_id session_id references orchestration_session.orchestration_session_id

Indexes

Column Name Index Name
orchestration_session_state_id sqlite_autoindex_orchestration_session_state_2
from_state sqlite_autoindex_orchestration_session_state_2
to_state sqlite_autoindex_orchestration_session_state_2
orchestration_session_state_id sqlite_autoindex_orchestration_session_state_1

SQL DDL

CREATE TABLE "orchestration_session_state" (
    "orchestration_session_state_id" VARCHAR PRIMARY KEY NOT NULL,
    "session_id" VARCHAR NOT NULL,
    "session_entry_id" VARCHAR,
    "from_state" TEXT NOT NULL,
    "to_state" TEXT NOT NULL,
    "transition_result" TEXT CHECK(json_valid(transition_result) OR transition_result IS NULL),
    "transition_reason" TEXT,
    "transitioned_at" TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
    "elaboration" TEXT CHECK(json_valid(elaboration) OR elaboration IS NULL),
    FOREIGN KEY("session_id") REFERENCES "orchestration_session"("orchestration_session_id"),
    FOREIGN KEY("session_entry_id") REFERENCES "orchestration_session_entry"("orchestration_session_entry_id"),
    UNIQUE("orchestration_session_state_id", "from_state", "to_state")
)