user_permission.js 508 B

1234567891011121314151617181920212223242526272829
  1. // Objection Docs:
  2. // http://vincit.github.io/objection.js/
  3. const db = require('../db');
  4. const Model = require('objection').Model;
  5. const now = require('./now_helper');
  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. module.exports = UserPermission;