diff --git a/src/migration/migrator.ts b/src/migration/migrator.ts index f95812321..609aa63d7 100644 --- a/src/migration/migrator.ts +++ b/src/migration/migrator.ts @@ -485,15 +485,9 @@ export class Migrator { migrations: ReadonlyArray, executedMigrations: ReadonlyArray ): ReadonlyArray { - let pendingMigrations: ReadonlyArray = [] - - migrations.forEach((migration) => { - if (!executedMigrations.includes(migration.name)) { - pendingMigrations = [...pendingMigrations, migration] - } + return migrations.filter((migration) => { + return !executedMigrations.includes(migration.name) }) - - return pendingMigrations } async #resolveMigrations(): Promise> {