diff --git a/test/backends/QueryRecordTest.cpp b/test/backends/QueryRecordTest.cpp index 2d42731..57d1f97 100644 --- a/test/backends/QueryRecordTest.cpp +++ b/test/backends/QueryRecordTest.cpp @@ -153,6 +153,31 @@ TEST_CASE_METHOD(QueryFixture, "Create and drop table statement", "[query][recor check_table_not_exists("person"); } +TEST_CASE_METHOD(QueryFixture, "Create table with identity primary key", "[query][record][create][identity]") { + check_table_not_exists("person"); + auto res = query::create() + .table("person") + .columns({ + column("id", basic_type::UInt32).primary_key().identity(), + column("name", basic_type::Varchar, 255), + column("age", basic_type::UInt16) + }) + .execute(db); + REQUIRE(res.is_ok()); + REQUIRE(res->affected_rows == 0); + + check_table_exists("person"); + tables_to_drop.emplace("person"); + + res = query::drop() + .table("person") + .execute(db); + REQUIRE(res.is_ok()); + REQUIRE(res->affected_rows == 0); + + check_table_not_exists("person"); +} + TEST_CASE_METHOD(QueryFixture, "Create and drop table statement with foreign key", "[query][record]") { auto res = query::create()