Skip to content

Commit

Permalink
Fix dynamic import path for js/ts migrations (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleJune authored Dec 4, 2021
1 parent 0695e7b commit 9135bb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
relative,
resolve,
StringReader,
toFileUrl,
walk,
} from "./deps.ts";

Expand Down Expand Up @@ -158,7 +159,7 @@ export abstract class Migrate<GenerateOptions = unknown> {
} else {
const { generateQueries, disableTransaction }: MigrationScript<
GenerateOptions
> = await import(path);
> = await import(toFileUrl(path).href);
if (!generateQueries) {
throw new Error(
"migration script must export generateQueries function",
Expand Down

0 comments on commit 9135bb8

Please sign in to comment.