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

[5.3] Swaps Drop for DropIfExists #15113

Merged
merged 1 commit into from
Aug 29, 2016
Merged

[5.3] Swaps Drop for DropIfExists #15113

merged 1 commit into from
Aug 29, 2016

Conversation

jesseschutt
Copy link
Contributor

During development I find myself migrating up and down frequently. If an error pops up that causes the migration to fail, it often requires manual db manipulation to get the migration flow running again. DropIfExists has helped in these situations.

Signed-off-by: Jesse Schutt jesse.schutt@zaengle.com

During development I find myself migrating up and down frequently. If an error pops up that causes the migration to fail, it often requires manual db manipulation to get the migration flow running again. DropIfExists has helped in these situations.

Signed-off-by: Jesse Schutt <jesse.schutt@zaengle.com>
@GrahamCampbell GrahamCampbell changed the title Swaps Drop for DropIfExists [5.3] Swaps Drop for DropIfExists Aug 28, 2016
@GrahamCampbell
Copy link
Member

Thanks, but I'm 👎 here.

@jesseschutt
Copy link
Contributor Author

jesseschutt commented Aug 28, 2016

Hey @GrahamCampbell , thanks for the feedback. Would you help me understand why this is a bad idea? Thank you!

@taylorotwell taylorotwell merged commit 83dbf6d into laravel:5.3 Aug 29, 2016
@tillkruss
Copy link
Contributor

@jschutt Thanks, I run into that frequently.

@GrahamCampbell
Copy link
Member

I'd say this is bad because it silently hides mistakes and allows you to write code that doesn't actually drop the correct table by mistake.

@jesseschutt
Copy link
Contributor Author

@GrahamCampbell Thanks!

I can see what you are saying by it not being quite as declarative, however, in either case using Drop or DropIfExists both ends up with the table being deleted.

@GrahamCampbell
Copy link
Member

Not if you have a typo in the table name though.

@jesseschutt
Copy link
Contributor Author

I appreciate the explanation @GrahamCampbell 👍

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