Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add action states #5983

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/migrations/20240119171200-action-states.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
exports.up = function (db, cb) {
db.runSql(
`
CREATE TABLE IF NOT EXISTS action_states
(
id SERIAL PRIMARY KEY NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
state VARCHAR(255) NOT NULL,
details VARCHAR(255),
action_id INTEGER NOT NULL,
observable_event_id INTEGER NOT NULL,
FOREIGN KEY (observable_event_id) references observable_events(id),
FOREIGN KEY (action_id) references actions(id)
);
`,
cb,
);
};

exports.down = function (db, cb) {
db.runSql(
`
DROP INDEX IF EXISTS idx_state_to_observable_event_id;
DROP TABLE IF EXISTS action_states;
`,
cb,
);
};
Loading