2018-12-11 18:47:12 -05:00
|
|
|
const migrate_name = 'forward_scheme';
|
|
|
|
const logger = require('../logger').migrate;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Migrate
|
|
|
|
*
|
|
|
|
* @see http://knexjs.org/#Schema
|
|
|
|
*
|
|
|
|
* @param {Object} knex
|
|
|
|
* @param {Promise} Promise
|
|
|
|
* @returns {Promise}
|
|
|
|
*/
|
|
|
|
exports.up = function (knex/*, Promise*/) {
|
2020-02-18 23:55:06 -05:00
|
|
|
logger.info('[' + migrate_name + '] Migrating Up...');
|
2018-12-11 18:47:12 -05:00
|
|
|
|
2020-02-18 23:55:06 -05:00
|
|
|
return knex.schema.table('proxy_host', function (proxy_host) {
|
|
|
|
proxy_host.string('forward_scheme').notNull().defaultTo('http');
|
|
|
|
})
|
|
|
|
.then(() => {
|
|
|
|
logger.info('[' + migrate_name + '] proxy_host Table altered');
|
|
|
|
});
|
2018-12-11 18:47:12 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Undo Migrate
|
|
|
|
*
|
|
|
|
* @param {Object} knex
|
|
|
|
* @param {Promise} Promise
|
|
|
|
* @returns {Promise}
|
|
|
|
*/
|
|
|
|
exports.down = function (knex, Promise) {
|
2020-02-18 23:55:06 -05:00
|
|
|
logger.warn('[' + migrate_name + '] You can\'t migrate down this one.');
|
|
|
|
return Promise.resolve(true);
|
2018-12-11 18:47:12 -05:00
|
|
|
};
|