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

[9.x] Added dropForeignIdFor method to match foreignIdFor method #40950

Merged
merged 5 commits into from
Feb 12, 2022

Conversation

bretto36
Copy link
Contributor

@bretto36 bretto36 commented Feb 11, 2022

Hi All

So i recently started using these foreignIdFor methods to make my migrations look so much nicer. But i found that the down() method of the migration didn't look as nice

Currently i'm writing

$table->foreignIdFor(\App\Models\Item::class);

and then to drop

$table->dropForeign('item_id')

This change introduces

$table->dropForeignIdFor(\App\Models\Item::class);

And also the constrained scenario

$table->foreignIdFor(\App\Models\Item::class)->constrained();

This change introduces

$table->dropConstrainedForeignIdFor(\App\Models\Item::class);

@driesvints driesvints changed the title Added dropForeignIdFor method to match foreignIdFor method [9.x] Added dropForeignIdFor method to match foreignIdFor method Feb 11, 2022
@driesvints
Copy link
Member

@bretto36 I believe the handling of $column in dropForeignIdFor is incorrect here. Please see #43753

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