From 81cdee6835bf1bdd87738014dc12fcc7ca02471e Mon Sep 17 00:00:00 2001 From: Paula Rinta-Harri Date: Tue, 9 Apr 2024 14:11:25 +0300 Subject: [PATCH] Add migration script for adding user_guid indexes --- .../1712659673740_add-user-guid-indexes.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 migrations/1712659673740_add-user-guid-indexes.js diff --git a/migrations/1712659673740_add-user-guid-indexes.js b/migrations/1712659673740_add-user-guid-indexes.js new file mode 100644 index 0000000..8bdfb11 --- /dev/null +++ b/migrations/1712659673740_add-user-guid-indexes.js @@ -0,0 +1,16 @@ +/* eslint-disable camelcase */ + +exports.shorthands = undefined + +exports.up = (pgm) => { + // Adding indexes + pgm.createIndex('completed_agegroup_entries', 'user_guid', { + ifNotExists: true, + }) + pgm.createIndex('favourite_tasks', 'user_guid', { ifNotExists: true }) + pgm.createIndex('notifications', 'user_guid', { ifNotExists: true }) + pgm.createIndex('task_entries', 'user_guid', { ifNotExists: true }) + pgm.createIndex('task_group_entries', 'user_guid', { ifNotExists: true }) +} + +exports.down = (pgm) => {}