mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
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.
33 lines
716 B
JavaScript
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',
|
|
},
|
|
},
|
|
};
|
|
}
|
|
}
|