]> 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 c12187871653bc124a1ae534be86c34f467b8895..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')
 
@@ -114,10 +115,12 @@ function createOAuthAdminIfNotExist (callback) {
     user.save(function (err, createdUser) {
       if (err) return callback(err)
 
-      logger.info('Username: ' + createdUser.username)
-      logger.info('User password: ' + createdUser.password)
+      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)
     })
   })
 }