mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-10-30 23:33:34 +00:00 
			
		
		
		
	Use model for db defaults as sqlite doesn't support them
This commit is contained in:
		| @@ -17,7 +17,7 @@ exports.up = function (knex/*, Promise*/) { | ||||
| 		proxy_host.integer('openidc_enabled').notNull().unsigned().defaultTo(0); | ||||
| 		proxy_host.text('openidc_redirect_uri').notNull().defaultTo(''); | ||||
| 		proxy_host.text('openidc_discovery').notNull().defaultTo(''); | ||||
| 		proxy_host.text('openidc_auth_method').notNull().defaultTo('client_secret_post'); | ||||
| 		proxy_host.text('openidc_auth_method').notNull().defaultTo(''); | ||||
| 		proxy_host.text('openidc_client_id').notNull().defaultTo(''); | ||||
| 		proxy_host.text('openidc_client_secret').notNull().defaultTo(''); | ||||
| 	}) | ||||
|   | ||||
| @@ -1,36 +0,0 @@ | ||||
| const migrate_name = 'openid_default_values'; | ||||
| 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.raw('ALTER TABLE proxy_host ALTER openidc_redirect_uri SET DEFAULT \'\'') | ||||
| 		.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_discovery SET DEFAULT \'\'')) | ||||
| 		.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_auth_method SET DEFAULT \'client_secret_post\'')) | ||||
| 		.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_client_id SET DEFAULT \'\'')) | ||||
| 		.then(() => knex.schema.raw('ALTER TABLE proxy_host ALTER openidc_client_secret SET DEFAULT \'\'')) | ||||
| 		.then(() => { | ||||
| 			logger.info('[' + migrate_name + '] proxy_host Table altered'); | ||||
| 		}); | ||||
| }; | ||||
|  | ||||
| /** | ||||
|  * Undo Migrate | ||||
|  * | ||||
|  * @param   {Object}  knex | ||||
|  * @param   {Promise} Promise | ||||
|  * @returns {Promise} | ||||
|  */ | ||||
| exports.down = function (knex, Promise) { | ||||
| 	logger.warn('[' + migrate_name + '] You can\'t migrate down this one.'); | ||||
| 	return Promise.resolve(true); | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user