Skip to content

Commit ed14404

Browse files
committed
Add PROXY protocol - not working yet
1 parent 763749b commit ed14404

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
const migrate_name = 'proxy_protocol';
2+
const logger = require('../logger').migrate;
3+
4+
/**
5+
* Migrate
6+
*
7+
* @see http://knexjs.org/#Schema
8+
*
9+
* @param {Object} knex
10+
* @param {Promise} Promise
11+
* @returns {Promise}
12+
*/
13+
exports.up = function (knex/*, Promise*/) {
14+
logger.info('[' + migrate_name + '] Migrating Up...');
15+
16+
return knex.schema.table('proxy_host', function (proxy_host) {
17+
proxy_host.integer('enable_proxy_protocol').notNull().unsigned().defaultTo(0);
18+
proxy_host.string('load_balancer_ip').notNull().defaultTo('');
19+
})
20+
.then(() => {
21+
logger.info('[' + migrate_name + '] proxy_host Table altered');
22+
});
23+
24+
};
25+
26+
/**
27+
* Undo Migrate
28+
*
29+
* @param {Object} knex
30+
* @param {Promise} Promise
31+
* @returns {Promise}
32+
*/
33+
exports.down = function (knex, Promise) {
34+
logger.warn('[' + migrate_name + '] You can\'t migrate down this one.');
35+
return Promise.resolve(true);
36+
};

0 commit comments

Comments
 (0)