diff options
author | Chocobozzz <me@florianbigard.com> | 2021-08-27 14:32:44 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-08-27 15:12:22 +0200 |
commit | 41fb13c330de629df2d23379209e79c7af0f2e9a (patch) | |
tree | 73bc5a90566406b3910f142beae2a879c1e4265d /server/initializers/migrator.ts | |
parent | 40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff) | |
download | PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.gz PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.tar.zst PeerTube-41fb13c330de629df2d23379209e79c7af0f2e9a.zip |
esModuleInterop to true
Diffstat (limited to 'server/initializers/migrator.ts')
-rw-r--r-- | server/initializers/migrator.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/initializers/migrator.ts b/server/initializers/migrator.ts index 77203ae24..7d7c9f8cb 100644 --- a/server/initializers/migrator.ts +++ b/server/initializers/migrator.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import * as path from 'path' | 1 | import { readdir } from 'fs-extra' |
2 | import { join } from 'path' | ||
3 | import { QueryTypes } from 'sequelize' | ||
2 | import { logger } from '../helpers/logger' | 4 | import { logger } from '../helpers/logger' |
3 | import { LAST_MIGRATION_VERSION } from './constants' | 5 | import { LAST_MIGRATION_VERSION } from './constants' |
4 | import { sequelizeTypescript } from './database' | 6 | import { sequelizeTypescript } from './database' |
5 | import { readdir } from 'fs-extra' | ||
6 | import { QueryTypes } from 'sequelize' | ||
7 | 7 | ||
8 | async function migrate () { | 8 | async function migrate () { |
9 | const tables = await sequelizeTypescript.getQueryInterface().showAllTables() | 9 | const tables = await sequelizeTypescript.getQueryInterface().showAllTables() |
@@ -58,7 +58,7 @@ export { | |||
58 | // --------------------------------------------------------------------------- | 58 | // --------------------------------------------------------------------------- |
59 | 59 | ||
60 | async function getMigrationScripts () { | 60 | async function getMigrationScripts () { |
61 | const files = await readdir(path.join(__dirname, 'migrations')) | 61 | const files = await readdir(join(__dirname, 'migrations')) |
62 | const filesToMigrate: { | 62 | const filesToMigrate: { |
63 | version: string | 63 | version: string |
64 | script: string | 64 | script: string |
@@ -88,7 +88,7 @@ async function executeMigration (actualVersion: number, entity: { version: strin | |||
88 | const migrationScriptName = entity.script | 88 | const migrationScriptName = entity.script |
89 | logger.info('Executing %s migration script.', migrationScriptName) | 89 | logger.info('Executing %s migration script.', migrationScriptName) |
90 | 90 | ||
91 | const migrationScript = require(path.join(__dirname, 'migrations', migrationScriptName)) | 91 | const migrationScript = require(join(__dirname, 'migrations', migrationScriptName)) |
92 | 92 | ||
93 | return sequelizeTypescript.transaction(async t => { | 93 | return sequelizeTypescript.transaction(async t => { |
94 | const options = { | 94 | const options = { |