Files
bigcapital/server/src/models/ViewColumn.js
Ahmed Bouhuolia ad00f140d1 feat: licenses administration basic authentication.
feat: accounts slug.
feat: duplicate accounts_balance table and merge balance with accounts table.
feat: refactoring customers and vendors.
feat: system user soft deleting.
feat: preventing build tenant database without any subscription.
feat: remove 'password' property from 'req.user' object.
feat: refactoring JournalPoster class.
feat: delete duplicated directories and files.
2020-09-09 21:30:19 +02:00

33 lines
716 B
JavaScript

import { Model } from 'objection';
import TenantModel from '@/models/TenantModel';
export default class ViewColumn extends TenantModel {
/**
* Table name.
*/
static get tableName() {
return 'view_has_columns';
}
/**
* Relationship mapping.
*/
static get relationMappings() {
const ResourceField = require('@/models/ResourceField');
return {
/**
* View role model may belongs to resource field model.
*/
field: {
relation: Model.BelongsToOneRelation,
modelClass: this.relationBindKnex(ResourceField.default),
join: {
from: 'view_has_columns.fieldId',
to: 'resource_fields.id',
},
},
};
}
}