2020-02-19 15:55:06 +11:00
|
|
|
// Objection Docs:
|
|
|
|
|
// http://vincit.github.io/objection.js/
|
|
|
|
|
|
2025-09-02 21:43:00 +10:00
|
|
|
import { Model } from "objection";
|
|
|
|
|
import db from "../db.js";
|
|
|
|
|
import now from "./now_helper.js";
|
2020-02-19 15:55:06 +11:00
|
|
|
|
2025-11-06 12:56:07 +10:00
|
|
|
Model.knex(db());
|
2020-02-19 15:55:06 +11:00
|
|
|
|
|
|
|
|
class UserPermission extends Model {
|
|
|
|
|
$beforeInsert () {
|
2020-07-19 16:37:44 +02:00
|
|
|
this.created_on = now();
|
|
|
|
|
this.modified_on = now();
|
2020-02-19 15:55:06 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$beforeUpdate () {
|
2020-07-19 16:37:44 +02:00
|
|
|
this.modified_on = now();
|
2020-02-19 15:55:06 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static get name () {
|
|
|
|
|
return 'UserPermission';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static get tableName () {
|
|
|
|
|
return 'user_permission';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-02 21:43:00 +10:00
|
|
|
export default UserPermission;
|