1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-03 09:49:17 +02:00
OpenSTF/lib/cli/migrate/index.js

22 lines
516 B
JavaScript

module.exports.command = 'migrate'
module.exports.describe = 'Migrates the database to the latest version.'
module.exports.builder = function(yargs) {
return yargs
}
module.exports.handler = function() {
var logger = require('../../util/logger')
var log = logger.createLogger('cli:migrate')
var db = require('../../db')
return db.setup()
.then(function() {
process.exit(0)
})
.catch(function(err) {
log.fatal('Migration had an error:', err.stack)
process.exit(1)
})
}