Fix a bug when creating models with composite keys in sqlite3 (#1310)

This commit is contained in:
Mai-Lapyst 2022-07-10 04:01:17 +02:00 committed by GitHub
parent da18f21796
commit 8b90403bae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -740,6 +740,11 @@ void create_model::createModelClassFromSqlite3(
} }
else if (pkNames.size() > 1) else if (pkNames.size() > 1)
{ {
for (auto &col : cols)
{
col.isAutoVal_ = false;
}
data["primaryKeyName"] = pkNames; data["primaryKeyName"] = pkNames;
data["primaryKeyType"] = pkTypes; data["primaryKeyType"] = pkTypes;
data["primaryKeyValNames"] = pkValNames; data["primaryKeyValNames"] = pkValNames;