fixed some repository-related tests
This commit is contained in:
@@ -385,8 +385,7 @@ TEST_CASE_METHOD(QueryFixture, "Select statement with foreign key and for single
|
||||
|
||||
TEST_CASE_METHOD(QueryFixture, "Select statement with many to many relationship", "[query][join][many_to_many]") {
|
||||
auto result = repo.attach<recipe>("recipes")
|
||||
.and_then( [this] { return repo.attach<ingredient>("ingredients"); } )
|
||||
.and_then( [this] { return repo.attach<recipe_ingredient>("recipe_ingredients"); } );
|
||||
.and_then( [this] { return repo.attach<ingredient>("ingredients"); } );
|
||||
|
||||
auto res = query::create()
|
||||
.table<recipe>("recipes", repo)
|
||||
@@ -462,7 +461,7 @@ TEST_CASE_METHOD(QueryFixture, "Select statement with many to many relationship"
|
||||
|
||||
for (const auto &ri: recipe_ingredients) {
|
||||
res = query::insert()
|
||||
.into("recipe_ingredients", column_generator::generate<recipe_ingredient>(repo, true))
|
||||
.into("recipe_ingredients", column_generator::generate(repo, "recipe_ingredients", true))
|
||||
.values({ri.first, ri.second})
|
||||
.execute(db);
|
||||
REQUIRE(res.is_ok());
|
||||
|
||||
@@ -28,7 +28,7 @@ struct flight {
|
||||
namespace field = matador::access;
|
||||
using namespace matador::utils;
|
||||
field::primary_key(op, "id", id);
|
||||
field::has_one(op, "airplane_id", plane, {utils::cascade_type::ALL, fetch_type::EAGER});
|
||||
field::belongs_to(op, "airplane_id", plane, {utils::cascade_type::ALL, fetch_type::EAGER});
|
||||
field::attribute(op, "pilot_name", pilot_name, 255);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user