Skip to content

Commit

Permalink
chore: add index for sync_config_id column in sync table (#2719)
Browse files Browse the repository at this point in the history
## Describe your changes
I have added the `sync_config_id` column to the `sync` table earlier
this week but I forgot to add an index to make the join with
`sync_config_table` faster
  • Loading branch information
TBonnin authored Sep 13, 2024
1 parent 5453900 commit 4ed946c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
exports.config = { transaction: false };

/**
* @param {import('knex').Knex} knex
*/
exports.up = async function (knex, _) {
await knex.schema.raw(
`CREATE INDEX CONCURRENTLY IF NOT EXISTS "idx_sync_config_id_where_deleted"
ON "_nango_syncs" USING BTREE ("sync_config_id")
WHERE deleted = false`
);
};
/**
* @param {import('knex').Knex} knex
*/
exports.down = async function (knex, _) {
await knex.schema.raw('DROP INDEX CONCURRENTLY IF EXISTS idx_sync_config_id_where_deleted');
};

0 comments on commit 4ed946c

Please sign in to comment.