mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
refactor(core): use default import for migration scripts
This commit is contained in:
parent
b367cd3380
commit
88b1384ccb
1 changed files with 5 additions and 4 deletions
|
@ -102,12 +102,13 @@ export const getUndeployedMigrations = async (pool: DatabasePool) => {
|
|||
};
|
||||
|
||||
const importMigration = async (file: string): Promise<MigrationScript> => {
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
const module = (await import(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const module = await import(
|
||||
path.join(migrationFilesDirectory, file).replace('node_modules/', '')
|
||||
)) as MigrationScript;
|
||||
);
|
||||
|
||||
return module;
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
return module.default as MigrationScript;
|
||||
};
|
||||
|
||||
const runMigration = async (pool: DatabasePool, file: string) => {
|
||||
|
|
Loading…
Reference in a new issue