aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/application.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
commit69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch)
treead199a18ec3c322460d6f9523fc383ee562554e0 /server/models/application.ts
parent4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff)
downloadPeerTube-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.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)