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

[8.x] Clarify required timestamp columns for pivot tables #6427

Merged
merged 2 commits into from
Sep 28, 2020

Conversation

driesvints
Copy link
Member

After researching laravel/framework#34548 I've come to the conclusion that pivot tables always require both a created_at and updated_at column because of their behavior of inheriting parent timestamp column names. This isn't immediately clear because for regular Eloquent models you can disable them by setting static::CREATED_AT and/or static::UPDATED_AT to null. So it's best to clarify the specific behavior here.

It could also be that we just don't support setting these constants to null in the first place and that both a created_at and updated_at column are always required? If so, then I think we should explicitly state that somewhere in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants