mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
fix: database migrations FK relations.
fix: database columns indexing.
This commit is contained in:
@@ -57,7 +57,7 @@ export default class SaleInvoice extends TenantModel {
|
||||
static get relationMappings() {
|
||||
const AccountTransaction = require('models/AccountTransaction');
|
||||
const ItemEntry = require('models/ItemEntry');
|
||||
const Customer = require('models/Customer');
|
||||
const Contact = require('models/Contact');
|
||||
const InventoryCostLotTracker = require('models/InventoryCostLotTracker');
|
||||
|
||||
return {
|
||||
@@ -75,11 +75,14 @@ export default class SaleInvoice extends TenantModel {
|
||||
|
||||
customer: {
|
||||
relation: Model.BelongsToOneRelation,
|
||||
modelClass: Customer.default,
|
||||
modelClass: Contact.default,
|
||||
join: {
|
||||
from: 'sales_invoices.customerId',
|
||||
to: 'customers.id',
|
||||
to: 'contacts.id',
|
||||
},
|
||||
filter(query) {
|
||||
query.where('contact_type', 'Customer');
|
||||
}
|
||||
},
|
||||
|
||||
transactions: {
|
||||
|
||||
Reference in New Issue
Block a user