Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primary key excluded from $_accessible array for has many relationship tables #835

Open
othercorey opened this issue Jun 15, 2022 · 4 comments

Comments

@othercorey
Copy link
Member

Description

If you have a table such as day_events which has day_id and created_at as the primary key, these columns are excluded from the generated $_accessible array in the Entity.

The created_at column will also be missing from the validator config in the Table.

Bake Version

2.7.0

PHP Version

No response

@othercorey othercorey changed the title Primary key from Entity $_accessible array for has many relationship tables Primary key excluded from $_accessible array for has many relationship tables Jun 15, 2022
@othercorey
Copy link
Member Author

This seems to expect the primary key to be generated. However, for multi-column keys, that's probably not true.

Users can work around it by removing the primary key and introducing the individual constraints they represent.

@ajibarra
Copy link
Member

ajibarra commented Jul 8, 2022

@othercorey Hi, so your suggestion would be adding both columns to $_accessible for multi-column primary key?

@othercorey
Copy link
Member Author

@othercorey Hi, so your suggestion would be adding both columns to $_accessible for multi-column primary key?

Yes. For a complete solution, we should decide if a primary key could be autogenerated or not.

@github-actions
Copy link

This issue is stale because it has been open for 120 days with no activity. Remove the stale label or comment or this will be closed in 15 days

@github-actions github-actions bot added the stale label Jan 11, 2023
@othercorey othercorey added pinned and removed stale labels Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants