Add composite primary keys

This page is a capture in the next bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.

We probably already have a story for this.

projects/ores.iam/include/ores.iam/repository/account_party_entity.hpp

sqlgen::PrimaryKey<std::string> account_id; std::string tenant_id; std::string party_id; Contributor @gemini-code-assist gemini-code-assist bot 15 hours ago high

The comment on line 32 indicates a composite primary key. For a junction table, both account_id and party_id should be part of the composite primary key. party_id should also be wrapped in sqlgen::PrimaryKey to correctly define the composite key.

Suggested change std::string party_id; sqlgen::PrimaryKey<std::string> party_id; Member Author @mcraveiro mcraveiro 5 hours ago

Won't fix. This follows the established junction entity pattern in the codebase (see dataset_bundle_member_entity.hpp): the left column uses sqlgen::PrimaryKey<std::string> and the right column uses plain std::string. The sqlgen library handles composite keys this way — the actual SQL DDL defines both columns as the composite primary key via the migration script, not via the C++ entity annotation.

Emacs 29.1 (Org mode 9.6.6)