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

[11.x] Added useCascadeTruncate method for PostgresGrammar #53343

Merged

Conversation

korkoshko
Copy link
Contributor

In the current version of Laravel, the cascade option is used for the truncate in Postgres. However, this behavior is not expected by many developers (issue #35157) as Postgres by default uses the restrict option
for truncate (https://www.postgresql.org/docs/current/sql-truncate.html#id-1.9.3.181.6).

For Laravel 11.x, it is proposed to add a new useCascadeTruncate method in the PostgresGrammar, allowing developers to disable the cascade behavior. This provides more control over how the truncate operation behaves in Postgres.

By default, the cascade behavior remains enabled in version 11.x to avoid BC.

Future Plans:

For versions 12.x or 13.x, we may consider changing the default behavior to disable the cascade option for truncate.
The upgrade notes will state that this behavior can be easily restored using the PostgresGrammar::useCascadeTruncate() method.

@taylorotwell taylorotwell merged commit 79897cd into laravel:11.x Oct 31, 2024
26 checks passed
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