🐛 Fix file path on windows (#7076)

* fix file path on windows

* file path in migrations

* release notes
This commit is contained in:
Michael Clark
2026-02-25 15:00:10 +00:00
committed by GitHub
parent a4bd301ec6
commit f97a89dc28
2 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import { readdir } from 'node:fs/promises';
import path, { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { fileURLToPath, pathToFileURL } from 'node:url';
import { load } from 'migrate';
@@ -30,7 +30,9 @@ export async function run(direction: 'up' | 'down' = 'up'): Promise<void> {
for (const f of files
.filter(f => f.endsWith('.js') || f.endsWith('.ts'))
.sort()) {
migrationsModules[f] = await import(path.join(migrationsDir, f));
migrationsModules[f] = await import(
pathToFileURL(path.join(migrationsDir, f)).href
);
}
return new Promise<void>((resolve, reject) => {

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [MikesGlitch]
---
Fix server migrations when running on Windows