schema creation progress

This commit is contained in:
2025-12-05 07:32:59 +01:00
parent d2f1bc0b8e
commit 98da0884f1
12 changed files with 122 additions and 117 deletions
-23
View File
@@ -20,8 +20,6 @@ TEST_CASE_METHOD(SessionFixture, "Session insert test", "[session][insert]") {
.and_then([this] { return ses.create_schema(); } );
REQUIRE(result.is_ok());
tables_to_drop.emplace("airplanes");
auto plane = ses.insert<airplane>(1, "Boeing", "A380");
REQUIRE(plane.is_ok());
@@ -38,8 +36,6 @@ TEST_CASE_METHOD(SessionFixture, "Session update test", "[session][update]") {
.and_then([this] { return ses.create_schema(); } );
REQUIRE(res.is_ok());
tables_to_drop.emplace("airplanes");
auto result = ses.insert<airplane>(1, "Boeing", "747");
REQUIRE(result.is_ok());
@@ -70,8 +66,6 @@ TEST_CASE_METHOD(SessionFixture, "Session delete test", "[session][delete]") {
.and_then([this] { return ses.create_schema(); } );
REQUIRE(res.is_ok());
tables_to_drop.emplace("airplanes");
auto result = ses.insert<airplane>(1, "Boeing", "747");
REQUIRE(result.is_ok());
@@ -94,9 +88,6 @@ TEST_CASE_METHOD(SessionFixture, "Session relation test", "[session][relation]")
.and_then([this] { return ses.create_schema(); } );
REQUIRE(result.is_ok());
tables_to_drop.emplace("airplanes");
tables_to_drop.emplace("flights");
auto plane = ses.insert<airplane>(1, "Boeing", "A380");
REQUIRE(plane.is_ok());
auto f = ses.insert<flight>(2, *plane, "sully");
@@ -118,8 +109,6 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find object with id", "[session
.and_then([this] { return ses.create_schema(); } );
REQUIRE(result.is_ok());
tables_to_drop.emplace("airplanes");
auto a380 = ses.insert<airplane>(1, "Boeing", "A380");
REQUIRE(a380.is_ok());
@@ -139,8 +128,6 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects", "[session][f
.and_then([this] { return ses.create_schema(); } );
REQUIRE(result.is_ok());
tables_to_drop.emplace("airplanes");
std::vector<std::unique_ptr<airplane>> planes;
planes.emplace_back(new airplane(1, "Airbus", "A380"));
planes.emplace_back(new airplane(2, "Boeing", "707"));
@@ -174,9 +161,6 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with one-to-ma
.and_then( [this] { return ses.attach<book>("books"); } )
.and_then( [this] { return ses.create_schema(); } );
tables_to_drop.emplace("authors");
tables_to_drop.emplace("books");
std::vector<std::unique_ptr<author>> authors;
authors.emplace_back(new author{1, "Michael", "Crichton", "23.10.1942", 1975, true, {}});
authors.emplace_back(new author{ 2, "Steven", "King", "21.9.1947", 1956, false, {}});
@@ -227,9 +211,6 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with one-to-ma
.and_then( [this] { return ses.attach<employee>("employees"); } )
.and_then( [this] { return ses.create_schema(); } );
tables_to_drop.emplace("departments");
tables_to_drop.emplace("employees");
std::vector<std::unique_ptr<department>> departments;
departments.emplace_back(new department{1, "Insurance", {}});
departments.emplace_back(new department{ 2, "Invoice", {}});
@@ -283,10 +264,6 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with many-to-m
.and_then( [this] { return ses.attach<ingredient>("ingredients"); } )
.and_then( [this] { return ses.create_schema(); } );
tables_to_drop.emplace("recipes");
tables_to_drop.emplace("ingredients");
tables_to_drop.emplace("recipe_ingredients");
std::vector<std::unique_ptr<ingredient>> ingredients;
ingredients.push_back(std::make_unique<ingredient>(1, "Apple"));
ingredients.push_back(std::make_unique<ingredient>(2, "Strawberry"));