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