aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/application.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/application.ts')
-rw-r--r--server/models/application.ts13
1 files changed, 4 insertions, 9 deletions
diff --git a/server/models/application.ts b/server/models/application.ts
index acd0dfbf2..14b87777a 100644
--- a/server/models/application.ts
+++ b/server/models/application.ts
@@ -35,7 +35,7 @@ export default function defineApplication (sequelize: Sequelize.Sequelize, DataT
35 35
36// --------------------------------------------------------------------------- 36// ---------------------------------------------------------------------------
37 37
38loadMigrationVersion = function (callback: (err: Error, version: number) => void) { 38loadMigrationVersion = function (callback: ApplicationMethods.LoadMigrationVersionCallback) {
39 const query = { 39 const query = {
40 attributes: [ 'migrationVersion' ] 40 attributes: [ 'migrationVersion' ]
41 } 41 }
@@ -47,15 +47,10 @@ loadMigrationVersion = function (callback: (err: Error, version: number) => void
47 }) 47 })
48} 48}
49 49
50updateMigrationVersion = function (newVersion: number, transaction: any, callback: any) { 50updateMigrationVersion = function (newVersion: number, transaction: Sequelize.Transaction, callback: ApplicationMethods.UpdateMigrationVersionCallback) {
51 const options: Sequelize.UpdateOptions = { 51 const options: Sequelize.UpdateOptions = {
52 where: {} 52 where: {},
53 } 53 transaction: transaction
54
55 if (!callback) {
56 transaction = callback
57 } else {
58 options.transaction = transaction
59 } 54 }
60 55
61 return Application.update({ migrationVersion: newVersion }, options).asCallback(callback) 56 return Application.update({ migrationVersion: newVersion }, options).asCallback(callback)