mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix: database migrations FK relations.
fix: database columns indexing.
This commit is contained in:
@@ -22,7 +22,7 @@ export default class BillPayment extends TenantModel {
|
||||
static get relationMappings() {
|
||||
const BillPaymentEntry = require('models/BillPaymentEntry');
|
||||
const AccountTransaction = require('models/AccountTransaction');
|
||||
const Vendor = require('models/Vendor');
|
||||
const Contact = require('models/Contact');
|
||||
const Account = require('models/Account');
|
||||
|
||||
return {
|
||||
@@ -37,11 +37,14 @@ export default class BillPayment extends TenantModel {
|
||||
|
||||
vendor: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: Vendor.default,
|
||||
modelClass: Contact.default,
|
||||
join: {
|
||||
from: 'bills_payments.vendorId',
|
||||
to: 'vendors.id',
|
||||
to: 'contacts.id',
|
||||
},
|
||||
filter(query) {
|
||||
query.where('contact_type', 'Vendor');
|
||||
}
|
||||
},
|
||||
|
||||
paymentAccount: {
|
||||
|
||||
Reference in New Issue
Block a user