user_permission.js 490 B

1234567891011121314151617181920212223242526272829
  1. // Objection Docs:
  2. // http://vincit.github.io/objection.js/
  3. import { Model } from "objection";
  4. import db from "../db.js";
  5. import now from "./now_helper.js";
  6. Model.knex(db);
  7. class UserPermission extends Model {
  8. $beforeInsert () {
  9. this.created_on = now();
  10. this.modified_on = now();
  11. }
  12. $beforeUpdate () {
  13. this.modified_on = now();
  14. }
  15. static get name () {
  16. return 'UserPermission';
  17. }
  18. static get tableName () {
  19. return 'user_permission';
  20. }
  21. }
  22. export default UserPermission;