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:
parent
7350c91a1e
commit
17c0d7137f
21
src/migrations/20240220130622-add-action-state-indexes.js
Normal file
21
src/migrations/20240220130622-add-action-state-indexes.js
Normal 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,
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user