0
Fork 0
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:
Gao Sun 2022-09-22 23:48:58 +08:00
parent b367cd3380
commit 88b1384ccb
No known key found for this signature in database
GPG key ID: 13EBE123E4773688

View file

@ -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) => {