]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/installer.js
Server: fix migration at installation
[github/Chocobozzz/PeerTube.git] / server / initializers / installer.js
index 974402094a168ce24d6f492147a5a25a42dffc8b..8c3148e79fc9576f476f74fc6280ca2c13ecb4ee 100644 (file)
@@ -13,6 +13,7 @@ const constants = require('./constants')
 const logger = require('../helpers/logger')
 const peertubeCrypto = require('../helpers/peertube-crypto')
 
+const Application = mongoose.model('Application')
 const Client = mongoose.model('OAuthClient')
 const User = mongoose.model('User')
 
@@ -117,7 +118,9 @@ function createOAuthAdminIfNotExist (callback) {
       logger.info('Username: ' + username)
       logger.info('User password: ' + password)
 
-      return callback(null)
+      logger.info('Creating Application collection.')
+      const application = new Application({ mongoSchemaVersion: constants.LAST_MONGO_SCHEMA_VERSION })
+      application.save(callback)
     })
   })
 }