Skip to content

Commit 002eaa2

Browse files
committed
Moved init flag to MigrationConfig in neon-http migrator
1 parent 1f6aa9e commit 002eaa2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drizzle-orm/src/neon-http/migrator.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type { NeonHttpDatabase } from './driver.ts';
1616
export async function migrate<TSchema extends Record<string, unknown>, TRelations extends AnyRelations>(
1717
db: NeonHttpDatabase<TSchema, TRelations>,
1818
config: MigrationConfig,
19-
init?: boolean,
2019
): Promise<void | MigratorInitFailResponse> {
2120
const migrations = readMigrationFiles(config);
2221
const migrationsTable = config.migrationsTable ?? '__drizzle_migrations';
@@ -37,7 +36,7 @@ export async function migrate<TSchema extends Record<string, unknown>, TRelation
3736
} order by created_at desc limit 1`,
3837
);
3938

40-
if (init) {
39+
if (typeof config === 'object' && config.init) {
4140
if (dbMigrations.length) {
4241
return { exitCode: 'manyMigrationsExist' };
4342
}

0 commit comments

Comments
 (0)