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

[6.x] Fix dropping columns with default value #31341

Merged

Conversation

yarik3351
Copy link
Contributor

@yarik3351 yarik3351 commented Feb 4, 2020

Issue: #4402

Select only rows where default_object_id is not 0.

A little modification of #31229 as fix from it did not work for a migration.

It appears that SQL query generated by #31229 selects all columns and take their [default_object_id] field but columns without default value have [default_object_id] = 0.
This pull request adds another condition to the query to take only fields where [default_object_id] !== 0.

End result

There in no need to specify dropping default constraints manually like proposed in issues like: #4402

Tests

Tests from original PR #31229 are suitable.

@yarik3351 yarik3351 changed the title Fix dropping columns with default value [6.x] Fix dropping columns with default value Feb 4, 2020
@joelharkes
Copy link
Contributor

@yarik3351 thanks for the fix, i was still looking into it :)

@taylorotwell taylorotwell merged commit 333b501 into laravel:6.x Feb 4, 2020
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