sequence table progress
This commit is contained in:
@@ -121,6 +121,26 @@ TEST_CASE_METHOD(SessionFixture, "Test insert object with has many relation with
|
||||
s_king->books.push_back(make_object<book_sequence>("Misery", nullobj, 1987));
|
||||
s_king->books.push_back(make_object<book_sequence>("The Dark Tower: The Gunslinger", nullobj, 1982));
|
||||
|
||||
auto res = ses.insert(s_king);
|
||||
REQUIRE(res.is_ok());
|
||||
}
|
||||
|
||||
TEST_CASE_METHOD(SessionFixture, "Test insert object with has many relation with table sequence", "[session][insert][has_many][table_sequence]") {
|
||||
const auto result = schema.attach<book_table>("books")
|
||||
.and_then( [this] { return schema.attach<author_table>("authors"); } )
|
||||
.and_then([this] { return schema.create(db); } );
|
||||
REQUIRE(result.is_ok());
|
||||
|
||||
session ses({bus, connection::dns, 4}, schema);
|
||||
|
||||
auto s_king = make_object<author_table>("Steven King");
|
||||
|
||||
s_king->books.push_back(make_object<book_table>("Carrie", nullobj, 1974));
|
||||
s_king->books.push_back(make_object<book_table>("The Shining", nullobj, 1977));
|
||||
s_king->books.push_back(make_object<book_table>("It", nullobj, 1986));
|
||||
s_king->books.push_back(make_object<book_table>("Misery", nullobj, 1987));
|
||||
s_king->books.push_back(make_object<book_table>("The Dark Tower: The Gunslinger", nullobj, 1982));
|
||||
|
||||
auto res = ses.insert(s_king);
|
||||
REQUIRE(res.is_ok());
|
||||
}
|
||||
Reference in New Issue
Block a user