]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/models/application.js
1 const mongoose
= require('mongoose')
3 // ---------------------------------------------------------------------------
5 const ApplicationSchema
= mongoose
.Schema({
12 ApplicationSchema
.statics
= {
13 loadMongoSchemaVersion
,
14 updateMongoSchemaVersion
17 mongoose
.model('Application', ApplicationSchema
)
19 // ---------------------------------------------------------------------------
21 function loadMongoSchemaVersion (callback
) {
22 return this.findOne({}, { mongoSchemaVersion: 1 }, function (err
, data
) {
23 const version
= data
? data
.mongoSchemaVersion : 0
25 return callback(err
, version
)
29 function updateMongoSchemaVersion (newVersion
, callback
) {
30 return this.update({}, { mongoSchemaVersion: newVersion
}, callback
)