mirror of
https://github.com/jc21/nginx-proxy-manager.git
synced 2024-08-30 18:22:48 +00:00
Migrations
This commit is contained in:
parent
eb20add0c7
commit
9b83d35ef4
@ -1,5 +1,5 @@
|
|||||||
const migrate_name = 'redirection_scheme';
|
const migrate_name = 'redirection_scheme';
|
||||||
const logger = require('../logger').migrate;
|
const logger = require('../logger').migrate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrate
|
* Migrate
|
||||||
@ -10,16 +10,16 @@ const logger = require('../logger').migrate;
|
|||||||
* @param {Promise} Promise
|
* @param {Promise} Promise
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
exports.up = function (knex, Promise) {
|
exports.up = function (knex/*, Promise*/) {
|
||||||
|
|
||||||
logger.info('[' + migrate_name + '] Migrating Up...');
|
logger.info('[' + migrate_name + '] Migrating Up...');
|
||||||
|
|
||||||
return knex.schema.table('redirection_host', (table) => {
|
return knex.schema.table('redirection_host', (table) => {
|
||||||
table.string('forward_scheme').notNull().defaultTo('$scheme');
|
table.string('forward_scheme').notNull().defaultTo('$scheme');
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
logger.info('[' + migrate_name + '] redirection_host Table altered');
|
logger.info('[' + migrate_name + '] redirection_host Table altered');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,13 +29,13 @@ exports.up = function (knex, Promise) {
|
|||||||
* @param {Promise} Promise
|
* @param {Promise} Promise
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
exports.down = function (knex, Promise) {
|
exports.down = function (knex/*, Promise*/) {
|
||||||
logger.info('[' + migrate_name + '] Migrating Down...');
|
logger.info('[' + migrate_name + '] Migrating Down...');
|
||||||
|
|
||||||
return knex.schema.table('redirection_host', (table) => {
|
return knex.schema.table('redirection_host', (table) => {
|
||||||
table.dropColumn('forward_scheme');
|
table.dropColumn('forward_scheme');
|
||||||
})
|
})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
logger.info('[' + migrate_name + '] redirection_host Table altered');
|
logger.info('[' + migrate_name + '] redirection_host Table altered');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,7 @@ const logger = require('../logger').migrate;
|
|||||||
* @param {Promise} Promise
|
* @param {Promise} Promise
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
exports.up = function (knex, Promise) {
|
exports.up = function (knex/*, Promise*/) {
|
||||||
|
|
||||||
logger.info('[' + migrate_name + '] Migrating Up...');
|
logger.info('[' + migrate_name + '] Migrating Up...');
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ exports.up = function (knex, Promise) {
|
|||||||
* @param {Promise} Promise
|
* @param {Promise} Promise
|
||||||
* @returns {Promise}
|
* @returns {Promise}
|
||||||
*/
|
*/
|
||||||
exports.down = function (knex, Promise) {
|
exports.down = function (knex/*, Promise*/) {
|
||||||
logger.info('[' + migrate_name + '] Migrating Down...');
|
logger.info('[' + migrate_name + '] Migrating Down...');
|
||||||
|
|
||||||
return knex.schema.table('redirection_host', (table) => {
|
return knex.schema.table('redirection_host', (table) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user