I have three tables and entities:
- customer
- shop
- shop_customer
Relation between those are:
Customer:
@OneToMany((type) => ShopCustomer, (shopCustomer) => shopCustomer.customer, { eager: false })
shopCustomer: ShopCustomer[];
Shop:
@OneToMany((type) => ShopCustomer, (shopCustomer) => shopCustomer.shop, { eager: false })
shopCustomer: ShopCustomer[];
ShopCustomer:
@ManyToOne((type) => Customer, (customer) => customer.shopCustomer, { eager: false })
customer: Customer;
@ManyToOne((type) => Shop, (shop) => shop.shopCustomer, { eager: false })
shop: Shop;
So the problem is that when I create migrations and run them, I get correct structure for shop_customer table, so:
id, customerId, shopId, Role
(Role is just a string)
The issue is with shop and customer tables. In those I get shopCustomerId columns created. Do you know what should I do in order to make it work?
Thank you for help <3