schema progress
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "matador/utils/access.hpp"
|
||||
#include "matador/utils/cascade_type.hpp"
|
||||
#include "matador/utils/fetch_type.hpp"
|
||||
#include "matador/utils/field_attributes.hpp"
|
||||
|
||||
#include "matador/sql/entity.hpp"
|
||||
@@ -29,7 +30,7 @@ struct flight
|
||||
namespace field = matador::utils::access;
|
||||
using namespace matador::utils;
|
||||
field::primary_key(op, "id", id);
|
||||
field::has_one(op, "airplane_id", airplane, utils::cascade_type::ALL);
|
||||
field::has_one(op, "airplane_id", airplane, {utils::cascade_type::ALL, utils::fetch_type::EAGER});
|
||||
field::attribute(op, "pilot_name", pilot_name, 255);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,7 +42,7 @@ struct order
|
||||
field::attribute(op, "ship_region", ship_region, 255);
|
||||
field::attribute(op, "ship_postal_code", ship_postal_code, 255);
|
||||
field::attribute(op, "ship_country", ship_country, 255);
|
||||
field::has_many(op, "order_details", order_details_, fetch_type::EAGER);
|
||||
field::has_many(op, "order_details", order_details_, utils::fetch_type::EAGER);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user