changed has_one to belongs_to
This commit is contained in:
parent
f32594d9fd
commit
5379324519
|
|
@ -30,8 +30,8 @@ struct product {
|
|||
namespace field = matador::access;
|
||||
using namespace matador::utils;
|
||||
field::primary_key(op, "product_name", product_name, 255);
|
||||
field::has_one(op, "supplier_id", supplier, utils::cascade_type::ALL);
|
||||
field::has_one(op, "category_id", category, utils::cascade_type::ALL);
|
||||
field::belongs_to(op, "supplier_id", supplier, utils::cascade_type::ALL);
|
||||
field::belongs_to(op, "category_id", category, utils::cascade_type::ALL);
|
||||
field::attribute(op, "quantity_per_unit", quantity_per_unit, 255);
|
||||
field::attribute(op, "unit_price", unit_price);
|
||||
field::attribute(op, "units_in_stock", units_in_stock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue