]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/migrator.ts
Fix refreshing external video attributes
[github/Chocobozzz/PeerTube.git] / server / initializers / migrator.ts
index 4663697299ff830f2825e7e5096f53f42d051deb..adc2f9fb370ddd9f15ddbd4838a2b5d6be6cac13 100644 (file)
@@ -1,8 +1,8 @@
 import * as path from 'path'
-import { readdirPromise } from '../helpers/core-utils'
 import { logger } from '../helpers/logger'
 import { LAST_MIGRATION_VERSION } from './constants'
 import { sequelizeTypescript } from './database'
+import { readdir } from 'fs-extra'
 
 async function migrate () {
   const tables = await sequelizeTypescript.getQueryInterface().showAllTables()
@@ -11,7 +11,7 @@ async function migrate () {
   // The installer will do that
   if (tables.length === 0) return
 
-  let actualVersion: number = null
+  let actualVersion: number | null = null
 
   const [ rows ] = await sequelizeTypescript.query('SELECT "migrationVersion" FROM "application"')
   if (rows && rows[0] && rows[0].migrationVersion) {
@@ -52,7 +52,7 @@ export {
 // ---------------------------------------------------------------------------
 
 async function getMigrationScripts () {
-  const files = await readdirPromise(path.join(__dirname, 'migrations'))
+  const files = await readdir(path.join(__dirname, 'migrations'))
   const filesToMigrate: {
     version: string,
     script: string