aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrator.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-08-27 14:32:44 +0200
committerChocobozzz <me@florianbigard.com>2021-08-27 15:12:22 +0200
commit41fb13c330de629df2d23379209e79c7af0f2e9a (patch)
tree73bc5a90566406b3910f142beae2a879c1e4265d /server/initializers/migrator.ts
parent40e7ed0714f96c01e16de3ac971a4b28116294e1 (diff)
downloadPeerTube-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.ts10
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 @@
1import * as path from 'path' 1import { readdir } from 'fs-extra'
2import { join } from 'path'
3import { QueryTypes } from 'sequelize'
2import { logger } from '../helpers/logger' 4import { logger } from '../helpers/logger'
3import { LAST_MIGRATION_VERSION } from './constants' 5import { LAST_MIGRATION_VERSION } from './constants'
4import { sequelizeTypescript } from './database' 6import { sequelizeTypescript } from './database'
5import { readdir } from 'fs-extra'
6import { QueryTypes } from 'sequelize'
7 7
8async function migrate () { 8async 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
60async function getMigrationScripts () { 60async 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 = {