Missing support for composite primary keys
Opened this issue · 0 comments
AnnoyingTechnology commented
Consider the following relation table :
CREATE TABLE "InterventionsLurkers" (
"id_intervention" integer NOT NULL,
"id_account" integer NOT NULL,
"last_seen_on" integer NOT NULL,
FOREIGN KEY ("id_intervention") REFERENCES "Interventions" ("id") ON DELETE CASCADE,
FOREIGN KEY ("id_account") REFERENCES "Accounts" ("id") ON DELETE CASCADE,
PRIMARY KEY ( "id_intervention", "id_account"),
UNIQUE ("id_intervention", "id_account")
);
Upon insertion of a new InterventionsLurkers
entity, the framework will try to retrieve the lastInsertedId()
and grab the frehsly inserted object by its ID.
This will fail and throw an exception due to the absence of id
column.
The solution could be either :
- Don't attempt to retrieve the object (feature not supported = silently ignore)
- Detect the absence of the
id
column, and use allid_*
columns to retrieve the object (and update/delete it later on?) instead of itsid