-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #883 from baruffaldi/master
Forward scheme and http code added for redirection hosts
- Loading branch information
Showing
11 changed files
with
159 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.8.0 | ||
2.8.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const migrate_name = 'redirection_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*/) { | ||
|
||
logger.info('[' + migrate_name + '] Migrating Up...'); | ||
|
||
return knex.schema.table('redirection_host', (table) => { | ||
table.string('forward_scheme').notNull().defaultTo('$scheme'); | ||
}) | ||
.then(function () { | ||
logger.info('[' + migrate_name + '] redirection_host Table altered'); | ||
}); | ||
}; | ||
|
||
/** | ||
* Undo Migrate | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex/*, Promise*/) { | ||
logger.info('[' + migrate_name + '] Migrating Down...'); | ||
|
||
return knex.schema.table('redirection_host', (table) => { | ||
table.dropColumn('forward_scheme'); | ||
}) | ||
.then(function () { | ||
logger.info('[' + migrate_name + '] redirection_host Table altered'); | ||
}); | ||
}; |
41 changes: 41 additions & 0 deletions
41
backend/migrations/20210210154703_redirection_status_code.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
const migrate_name = 'redirection_status_code'; | ||
const logger = require('../logger').migrate; | ||
|
||
/** | ||
* Migrate | ||
* | ||
* @see http://knexjs.org/#Schema | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.up = function (knex/*, Promise*/) { | ||
|
||
logger.info('[' + migrate_name + '] Migrating Up...'); | ||
|
||
return knex.schema.table('redirection_host', (table) => { | ||
table.integer('forward_http_code').notNull().unsigned().defaultTo(302); | ||
}) | ||
.then(function () { | ||
logger.info('[' + migrate_name + '] redirection_host Table altered'); | ||
}); | ||
}; | ||
|
||
/** | ||
* Undo Migrate | ||
* | ||
* @param {Object} knex | ||
* @param {Promise} Promise | ||
* @returns {Promise} | ||
*/ | ||
exports.down = function (knex/*, Promise*/) { | ||
logger.info('[' + migrate_name + '] Migrating Down...'); | ||
|
||
return knex.schema.table('redirection_host', (table) => { | ||
table.dropColumn('forward_http_code'); | ||
}) | ||
.then(function () { | ||
logger.info('[' + migrate_name + '] redirection_host Table altered'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters