Add a REINDEX NOCASE v2.15.1 migration and update v2.15.0 migration (#3533)

* Add REINDEX NOCASE migration and update v2.15.0 migration

* Update v2.15.0 migration test

* Fix typo
This commit is contained in:
mikiher 2024-10-19 00:10:29 +03:00 committed by GitHub
parent 9327331ee9
commit 50797879d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 107 additions and 52 deletions

View file

@ -18,6 +18,10 @@ async function up({ context: { queryInterface, logger } }) {
// Upwards migration script
logger.info('[2.15.0 migration] UPGRADE BEGIN: 2.15.0-series-column-unique ')
// Run reindex nocase to fix potential corruption issues due to the bad sqlite extension introduced in v2.12.0
logger.info('[2.15.0 migration] Reindexing NOCASE indices to fix potential hidden corruption issues')
await queryInterface.sequelize.query('REINDEX NOCASE;')
// Check if the unique index already exists
const seriesIndexes = await queryInterface.showIndex('Series')
if (seriesIndexes.some((index) => index.name === 'unique_series_name_per_library')) {