1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat: add action states (#5983)

## About the changes
Add action states table without an index yet
This commit is contained in:
Gastón Fournier 2024-01-22 11:49:35 +01:00 committed by GitHub
parent c9b99f41cf
commit 8ba5cdced1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
);
};