aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrator.ts
diff options
context:
space:
mode:
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 = {