From 2ca3cbe6fd17ffbcb1e56d99e3375ea82e78c921 Mon Sep 17 00:00:00 2001 From: csmig Date: Mon, 21 Oct 2024 19:47:45 -0400 Subject: [PATCH] feat: add index for asset/collection state column --- api/source/service/migrations/0034.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 api/source/service/migrations/0034.js diff --git a/api/source/service/migrations/0034.js b/api/source/service/migrations/0034.js new file mode 100644 index 00000000..df5ea95b --- /dev/null +++ b/api/source/service/migrations/0034.js @@ -0,0 +1,20 @@ +const MigrationHandler = require('./lib/MigrationHandler') + +const upMigration = [ + `ALTER TABLE asset ADD INDEX idx_state (state ASC)`, + `ALTER TABLE collection ADD INDEX idx_state (state ASC)` +] + +const downMigration = [ +] + +const migrationHandler = new MigrationHandler(upMigration, downMigration) +module.exports = { + up: async (pool) => { + await migrationHandler.up(pool, __filename) + }, + down: async (pool) => { + await migrationHandler.down(pool, __filename) + } +} +