mirror of
https://github.com/directus/directus.git
synced 2026-01-22 22:38:12 -05:00
Windows compatibility for running migrations (#18082)
* Prepend the file:// prefix for windows compatibility in migrations * cla
This commit is contained in:
@@ -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}...`);
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
- rijkvanzanten
|
||||
- paescuj
|
||||
- br41nslug
|
||||
|
||||
Reference in New Issue
Block a user