Windows compatibility for running migrations (#18082)

* Prepend the file:// prefix for windows compatibility in migrations

* cla
This commit is contained in:
Brainslug
2023-04-06 15:04:18 +02:00
committed by GitHub
parent b01896314f
commit bc8457e996
2 changed files with 4 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ export default async function run(database: Knex, direction: 'up' | 'down' | 'la
throw Error('Nothing to upgrade');
}
const { up } = await import(nextVersion.file);
const { up } = await import(`file://${nextVersion.file}`);
if (log) {
logger.info(`Applying ${nextVersion.name}...`);
@@ -90,7 +90,7 @@ export default async function run(database: Knex, direction: 'up' | 'down' | 'la
throw new Error("Couldn't find migration");
}
const { down } = await import(migration.file);
const { down } = await import(`file://${migration.file}`);
if (log) {
logger.info(`Undoing ${migration.name}...`);
@@ -103,7 +103,7 @@ export default async function run(database: Knex, direction: 'up' | 'down' | 'la
async function latest() {
for (const migration of migrations) {
if (migration.completed === false) {
const { up } = await import(migration.file);
const { up } = await import(`file://${migration.file}`);
if (log) {
logger.info(`Applying ${migration.name}...`);

View File

@@ -1,2 +1,3 @@
- rijkvanzanten
- paescuj
- br41nslug