Adding table to track workflow executions.

- Data from this table will be used to generate workflow statistics.
This commit is contained in:
Aleksandr Melnikov 2020-04-13 14:30:26 -07:00
parent e0f9b77846
commit 6fc161b128

View File

@ -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