diff --git a/src/mikro/schema.ts b/src/mikro/schema.ts index a25c9f0..5e98742 100644 --- a/src/mikro/schema.ts +++ b/src/mikro/schema.ts @@ -30,7 +30,7 @@ export const CustomerSchema = new EntitySchema({ country: { type: 'string' }, phone: { type: 'string' }, fax: { type: 'string', nullable: true }, - orders: { reference: '1:m', entity: () => Order, mappedBy: 'customer' }, + orders: { kind: '1:m', entity: () => Order, mappedBy: 'customer' }, }, }); @@ -53,8 +53,8 @@ export const OrderDetailSchema = new EntitySchema({ discount: { type: 'number' }, orderId: { type: 'string', primary: true, fieldName: 'order_id' }, productId: { type: 'string', primary: true, fieldName: 'product_id' }, - order: { reference: 'm:1', entity: () => Order }, - product: { reference: 'm:1', entity: () => Product }, + order: { kind: 'm:1', entity: () => Order }, + product: { kind: 'm:1', entity: () => Product }, }, }); @@ -96,7 +96,7 @@ export const EmployeeSchema = new EntitySchema({ extension: { type: 'number' }, notes: { type: 'string' }, recipientId: { type: 'string', nullable: true, fieldName: 'recipient_id' }, - orders: { reference: '1:m', entity: () => Order, mappedBy: 'employee' }, + orders: { kind: '1:m', entity: () => Order, mappedBy: 'employee' }, }, }); @@ -136,9 +136,9 @@ export const OrderSchema = new EntitySchema({ shipCountry: { type: 'string', fieldName: 'ship_country' }, customerId: { type: 'string', fieldName: 'customer_id' }, employeeId: { type: 'string', fieldName: 'employee_id' }, - customer: { reference: 'm:1', entity: () => Customer }, - employee: { reference: 'm:1', entity: () => Employee }, - orderDetails: { reference: '1:m', entity: () => OrderDetail, mappedBy: 'order' }, + customer: { kind: 'm:1', entity: () => Customer }, + employee: { kind: 'm:1', entity: () => Employee }, + orderDetails: { kind: '1:m', entity: () => OrderDetail, mappedBy: 'order' }, }, }); @@ -169,8 +169,8 @@ export const ProductSchema = new EntitySchema({ reorderLevel: { type: 'number', fieldName: 'reorder_level' }, discontinued: { type: 'number' }, supplierId: { type: 'string', fieldName: 'supplier_id' }, - supplier: { reference: 'm:1', entity: () => Supplier }, - orderDetails: { reference: '1:m', entity: () => OrderDetail, mappedBy: 'product' }, + supplier: { kind: 'm:1', entity: () => Supplier }, + orderDetails: { kind: '1:m', entity: () => OrderDetail, mappedBy: 'product' }, }, }); @@ -202,6 +202,6 @@ export const SupplierSchema = new EntitySchema({ postalCode: { type: 'string', fieldName: 'postal_code' }, country: { type: 'string' }, phone: { type: 'string' }, - products: { reference: '1:m', entity: () => Product, mappedBy: 'supplier' }, + products: { kind: '1:m', entity: () => Product, mappedBy: 'supplier' }, }, }); \ No newline at end of file