File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
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
+ } ;
You can’t perform that action at this time.
0 commit comments