mirror of
				https://github.com/NginxProxyManager/nginx-proxy-manager.git
				synced 2025-10-31 15:53:33 +00:00 
			
		
		
		
	introduced now_helper for multidb capabilities
This commit is contained in:
		| @@ -3,13 +3,14 @@ | ||||
|  | ||||
| const db    = require('../db'); | ||||
| const Model = require('objection').Model; | ||||
| const now   = require('./now_helper'); | ||||
|  | ||||
| Model.knex(db); | ||||
|  | ||||
| class AccessListClient extends Model { | ||||
| 	$beforeInsert () { | ||||
| 		this.created_on  = Model.raw('NOW()'); | ||||
| 		this.modified_on = Model.raw('NOW()'); | ||||
| 		this.created_on  = now(); | ||||
| 		this.modified_on = now(); | ||||
|  | ||||
| 		// Default for meta | ||||
| 		if (typeof this.meta === 'undefined') { | ||||
| @@ -18,7 +19,7 @@ class AccessListClient extends Model { | ||||
| 	} | ||||
|  | ||||
| 	$beforeUpdate () { | ||||
| 		this.modified_on = Model.raw('NOW()'); | ||||
| 		this.modified_on = now(); | ||||
| 	} | ||||
|  | ||||
| 	static get name () { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user