2020-04-14 05:30:26 +08:00
|
|
|
-- +goose Up
|
|
|
|
-- +goose StatementBegin
|
|
|
|
CREATE TABLE workflow_executions
|
|
|
|
(
|
|
|
|
id serial PRIMARY KEY,
|
2020-05-16 04:11:04 +08:00
|
|
|
uid varchar(30) UNIQUE NOT NULL CHECK(uid <> ''),
|
2020-04-14 05:30:26 +08:00
|
|
|
workflow_template_id integer NOT NULL REFERENCES workflow_templates ON DELETE CASCADE,
|
|
|
|
name text NOT NULL CHECK (name <> ''),
|
2020-05-09 07:05:17 +08:00
|
|
|
namespace varchar(30) NOT NULL,
|
2020-04-14 05:30:26 +08:00
|
|
|
|
|
|
|
-- 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
|