From 6fc161b128db6d29fd92d140521089327bc93aca Mon Sep 17 00:00:00 2001 From: Aleksandr Melnikov Date: Mon, 13 Apr 2020 14:30:26 -0700 Subject: [PATCH] Adding table to track workflow executions. - Data from this table will be used to generate workflow statistics. --- ...1037_createworkflowexecutionstatistics.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 db/20200413141037_createworkflowexecutionstatistics.sql diff --git a/db/20200413141037_createworkflowexecutionstatistics.sql b/db/20200413141037_createworkflowexecutionstatistics.sql new file mode 100644 index 0000000..1a21b01 --- /dev/null +++ b/db/20200413141037_createworkflowexecutionstatistics.sql @@ -0,0 +1,20 @@ +-- +goose Up +-- +goose StatementBegin +CREATE TABLE workflow_executions +( + id serial PRIMARY KEY, + workflow_template_id integer NOT NULL REFERENCES workflow_templates ON DELETE CASCADE, + name text NOT NULL CHECK (name <> ''), + namespace varchar(36) NOT NULL, + + -- auditing info + created_at timestamp NOT NULL DEFAULT (NOW() at time zone 'utc'), + finished_at timestamp DEFAULT NULL, + failed_at timestamp DEFAULT NULL +); +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +DROP TABLE workflow_executions; +-- +goose StatementEnd