mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-17 17:56:27 +00:00
introduced now_helper for multidb capabilities
This commit is contained in:
13
backend/models/now_helper.js
Normal file
13
backend/models/now_helper.js
Normal file
@ -0,0 +1,13 @@
|
||||
const db = require('../db');
|
||||
const config = require('config');
|
||||
const Model = require('objection').Model;
|
||||
|
||||
Model.knex(db);
|
||||
|
||||
module.exports = function () {
|
||||
if (config.database.knex && config.database.knex.client === 'sqlite3') {
|
||||
return Model.raw('date(\'now\')');
|
||||
} else {
|
||||
return Model.raw('NOW()');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user