Skip to content

Commit

Permalink
Add migration scripts for adding task_guid, taskgroup_guid and agegro…
Browse files Browse the repository at this point in the history
…up_guid indexes
  • Loading branch information
orangit-jaakko-makela committed May 22, 2024
1 parent 1609656 commit b2e6c6c
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
23 changes: 23 additions & 0 deletions migrations/1715937269727_add-task-guid-indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable camelcase */

exports.shorthands = undefined

exports.up = (pgm) => {
// Adding indexes
pgm.createIndex('favourite_tasks', 'task_guid', {
ifNotExists: true,
name: 'favourite_tasks_task_guid_idx',
})

pgm.createIndex('task_entries', 'task_guid', {
ifNotExists: true,
name: 'task_entries_task_guid_idx',
})

pgm.createIndex('task_entries_history', 'task_guid', {
ifNotExists: true,
name: 'task_entries_history_task_guid_idx',
})
}

exports.down = (pgm) => {}
18 changes: 18 additions & 0 deletions migrations/1715937269921_add-taskgroup-guid-indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable camelcase */

exports.shorthands = undefined

exports.up = (pgm) => {
pgm.createIndex('task_group_entries', 'taskgroup_guid', {
ifNotExists: true,
name: 'task_group_entries_taskgroup_guid_idx',
})

// task_group_entries_history
pgm.createIndex('task_group_entries_history', 'taskgroup_guid', {
ifNotExists: true,
name: 'task_group_entries_history_taskgroup_guid_idx',
})
}

exports.down = (pgm) => {}
12 changes: 12 additions & 0 deletions migrations/1715945956654_add-agegroup-guid-indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable camelcase */

exports.shorthands = undefined

exports.up = (pgm) => {
pgm.createIndex('completed_agegroup_entries', 'agegroup_guid', {
ifNotExists: true,
name: 'completed_agegroup_entries_agegroup_guid_idx',
})
}

exports.down = (pgm) => {}

0 comments on commit b2e6c6c

Please sign in to comment.