Skip to content

Commit

Permalink
feat: add index for asset/collection state column
Browse files Browse the repository at this point in the history
  • Loading branch information
csmig committed Oct 21, 2024
1 parent edeb2be commit 2ca3cbe
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/source/service/migrations/0034.js
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 2ca3cbe

Please sign in to comment.