Closed mehov closed 1 month ago
Side note:
Personally I always use AIID id
as primary key here, on top.
The data overhead is minimal, and it makes everything much easier, incl manual edit/delete if necessary through backend or otherwise. They don't have to be exposed at all.
Please use one of the support channels for your queries.
@dereuromark Thanks for the tip, I tried that too and it worked.
@ADmad Okay, I re-read my initial OP, and it did look like a stackoverflow question, so you have a point. I edited it.
I'll make a PR
https://book.cakephp.org/5/en/orm/associations.html#belongstomany-associations
I have a joining table table like that (with just
article_id
andtag_id
), serving a belongsToMany association. When I save my data as per https://book.cakephp.org/5/en/orm/saving-data.html#saving-belongstomany-associations, I am getting:I tried adding an index of type PRIMARY that includes both columns and it worked.
Please make it say that either an ID is required, or you have to add a multiple-column PRIMARY index on both columns.