File tree 1 file changed +36
-0
lines changed 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ const migrate_name = 'openid_default_values' ;
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 . raw ( 'ALTER TABLE proxy_host ALTER openidc_redirect_uri SET DEFAULT \'\'' )
17
+ . then ( ( ) => knex . schema . raw ( 'ALTER TABLE proxy_host ALTER openidc_discovery SET DEFAULT \'\'' ) )
18
+ . then ( ( ) => knex . schema . raw ( 'ALTER TABLE proxy_host ALTER openidc_auth_method SET DEFAULT \'client_secret_post\'' ) )
19
+ . then ( ( ) => knex . schema . raw ( 'ALTER TABLE proxy_host ALTER openidc_client_id SET DEFAULT \'\'' ) )
20
+ . then ( ( ) => knex . schema . raw ( 'ALTER TABLE proxy_host ALTER openidc_client_secret SET DEFAULT \'\'' ) )
21
+ . then ( ( ) => {
22
+ logger . info ( '[' + migrate_name + '] proxy_host Table altered' ) ;
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