diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
commit | 69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch) | |
tree | ad199a18ec3c322460d6f9523fc383ee562554e0 /server/models/application.ts | |
parent | 4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff) | |
download | PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip |
Type functions
Diffstat (limited to 'server/models/application.ts')
-rw-r--r-- | server/models/application.ts | 13 |
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 | ||
38 | loadMigrationVersion = function (callback: (err: Error, version: number) => void) { | 38 | loadMigrationVersion = 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 | ||
50 | updateMigrationVersion = function (newVersion: number, transaction: any, callback: any) { | 50 | updateMigrationVersion = 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) |