Skip to content

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.

@kravchenko-a
Copy link

@taylorotwell missing letter "n" in word "Trucate" in method name PostgresGrammar::cascadeOnTrucate()

@AndrewMast
Copy link
Contributor

@kravchenko-a The typo was fixed in #55218

@kravchenko-a
Copy link

@AndrewMast Thanks! I see that this is fixed only in Laravel 12?

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.

4 participants