From 8b90403bae75025d51f1b0ced83c01771b5837ab Mon Sep 17 00:00:00 2001 From: Mai-Lapyst <67418776+Mai-Lapyst@users.noreply.github.com> Date: Sun, 10 Jul 2022 04:01:17 +0200 Subject: [PATCH] Fix a bug when creating models with composite keys in sqlite3 (#1310) --- drogon_ctl/create_model.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drogon_ctl/create_model.cc b/drogon_ctl/create_model.cc index 12288c96..b929720f 100644 --- a/drogon_ctl/create_model.cc +++ b/drogon_ctl/create_model.cc @@ -740,6 +740,11 @@ void create_model::createModelClassFromSqlite3( } else if (pkNames.size() > 1) { + for (auto &col : cols) + { + col.isAutoVal_ = false; + } + data["primaryKeyName"] = pkNames; data["primaryKeyType"] = pkTypes; data["primaryKeyValNames"] = pkValNames;