From 4519f231a3c9eab79c3127ecfc22e82b13d83d1c Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Tue, 4 Mar 2025 06:35:22 -0800 Subject: [PATCH] Make migration error checking more resilient --- src/photo/db/migration.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/photo/db/migration.ts b/src/photo/db/migration.ts index 43205117..8693e3f3 100644 --- a/src/photo/db/migration.ts +++ b/src/photo/db/migration.ts @@ -54,8 +54,9 @@ export const MIGRATIONS: Migration[] = [{ export const migrationForError = (e: any) => MIGRATIONS.find(migration => - migration.fields.some(field => - new RegExp(`column "${field}" of relation "photos" does not exist`, 'i') - .test(e.message), - ), + migration.fields.some(field =>( + // eslint-disable-next-line max-len + new RegExp(`column "${field}" of relation "photos" does not exist`, 'i').test(e.message) || + new RegExp(`column "${field}" does not exist`, 'i').test(e.message) + )), ); \ No newline at end of file