8000 Revert cascading truncations by blakethepatton · Pull Request #34476 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

Revert cascading truncations #34476

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

Closed
wants to merge 1 commit into from
Closed

Conversation

blakethepatton
Copy link
Contributor

This PR reverses #26389 which introduces cascading truncations in postgres. The spirit of the original fix was to address a constraint of postgres in that disabling foreign key constrains does not allow a developer to a truncate a table that has foreign keys. However, the proposed and accepted solution results in all tables that have a column that references the table under question for truncation to be also truncated and further any tables that referenced the children of the first table. This can and has created a problematic situation when you discover that truncating a small table results in the loss of your entire database.

As that is not expected behavior for truncation of a table, I would propose that the word cascading be removed from truncation and that documentation be created in the laravel docs indicating that this was the behavior in postgres between version [initial release version] and [this release version].

Issue: #29506

@blakethepatton blakethepatton changed the title Remove DANGEROUS cascade statement from truncate query Revert cascading truncations Sep 23, 2020
@rimace
Copy link
Contributor
rimace commented Sep 23, 2020

@blakethepatton Usually a PR is done on the oldest supported branch and this branch is then merged into the newer ones. So I guess you can close the other ones.

@GrahamCampbell
Copy link
Member

Please send to 6.x only.

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.

3 participants
0