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

chore: add action state db indexes (#6283)

Adds some relevant indexes to `action_states`, useful for our new
"action events" query.
This commit is contained in:
Nuno Góis 2024-02-20 15:45:33 +00:00 committed by GitHub
parent 7350c91a1e
commit 17c0d7137f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,21 @@
exports.up = function (db, cb) {
db.runSql(
`
CREATE INDEX IF NOT EXISTS idx_action_states_action_id ON action_states(action_id);
CREATE INDEX IF NOT EXISTS idx_action_states_observable_event_id ON action_states(observable_event_id);
CREATE INDEX IF NOT EXISTS idx_action_states_action_observable ON action_states(action_id, observable_event_id);
`,
cb,
);
};
exports.down = function (db, cb) {
db.runSql(
`
DROP INDEX IF EXISTS idx_action_states_action_id;
DROP INDEX IF EXISTS idx_action_states_observable_event_id;
DROP INDEX IF EXISTS idx_action_states_action_observable;
`,
cb,
);
};