1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Server: Fixed incorrectly named database migration that prevents new migrations from being applied

This commit is contained in:
Laurent Cozic
2025-07-20 11:01:57 +01:00
parent 898888088c
commit 91b0ea609d

View File

@@ -287,12 +287,17 @@ export const sqliteSyncSlave = async (master: DbConnection, slave: DbConnection)
await reconnectDb(slave);
};
// This can be used to fix migration names, once the migration has already been deployed.
// Incorrectly named migrations may end up being applied in the wrong order.
const fixMigrationNames = async (db: DbConnection) => {
// This can be used to fix migration names, once the migration has already been deployed.
// Incorrectly named migrations may end up being applied in the wrong order.
await db('knex_migrations')
.update({ name: '20250404091200_user_auth_code.js' })
.where('name', '=', '202504040912000_user_auth_code.js');
try {
await db('knex_migrations')
.update({ name: '20250404091200_user_auth_code.js' })
.where('name', '=', '202504040912000_user_auth_code.js');
} catch (error) {
if (isNoSuchTableError(error)) return;
throw error;
}
};
export async function migrateLatest(db: DbConnection, disableTransactions = false) {