mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
fix: database migrations FK relations.
fix: database columns indexing.
This commit is contained in:
@@ -36,17 +36,20 @@ export default class Bill extends TenantModel {
|
||||
* Relationship mapping.
|
||||
*/
|
||||
static get relationMappings() {
|
||||
const Vendor = require('models/Vendor');
|
||||
const Contact = require('models/Contact');
|
||||
const ItemEntry = require('models/ItemEntry');
|
||||
|
||||
return {
|
||||
vendor: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: Vendor.default,
|
||||
modelClass: Contact.default,
|
||||
join: {
|
||||
from: 'bills.vendorId',
|
||||
to: 'vendors.id',
|
||||
to: 'contacts.id',
|
||||
},
|
||||
filter(query) {
|
||||
query.where('contact_type', 'Vendor');
|
||||
}
|
||||
},
|
||||
|
||||
entries: {
|
||||
|
||||
Reference in New Issue
Block a user