fix(server): migration script running on windows (#6077)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { readdirSync } from 'node:fs';
|
import { readdirSync } from 'node:fs';
|
||||||
import { join } from 'node:path';
|
import { join } from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
||||||
|
|
||||||
import { Logger } from '@nestjs/common';
|
import { Logger } from '@nestjs/common';
|
||||||
import { ModuleRef } from '@nestjs/core';
|
import { ModuleRef } from '@nestjs/core';
|
||||||
@@ -25,7 +25,7 @@ export async function collectMigrations(): Promise<Migration[]> {
|
|||||||
|
|
||||||
const migrations: Migration[] = await Promise.all(
|
const migrations: Migration[] = await Promise.all(
|
||||||
migrationFiles.map(async file => {
|
migrationFiles.map(async file => {
|
||||||
return import(file).then(mod => {
|
return import(pathToFileURL(file).href).then(mod => {
|
||||||
const migration = mod[Object.keys(mod)[0]];
|
const migration = mod[Object.keys(mod)[0]];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user