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

Swaps Drop for DropIfExists #445

Closed
wants to merge 1 commit into from
Closed

Conversation

yakidahan
Copy link

No description provided.

@quetzyg
Copy link
Contributor

quetzyg commented Sep 16, 2018

What's the reason?

@quetzyg quetzyg self-assigned this Sep 16, 2018
@yakidahan
Copy link
Author

Well one use case would be when I want to rollback the migrations, but before that I delete the audits table by hand from the database. When using drop with the rollback you will get an error since the table doesn't exist anymore and the rollback would fail. If I use dropIfExists the rollback would succeed.

@quetzyg
Copy link
Contributor

quetzyg commented Sep 17, 2018

Sorry, but I don't see the point. If you're deleting tables by hand, you might as well delete the appropriate entry from the migrations table too, while you're at it (if you're into manually changing stuff).

The point of using migrations is that you don't make changes by hand, you just migrate/rollback via artisan.

@quetzyg quetzyg closed this Sep 17, 2018
@yakidahan
Copy link
Author

In addition it is the default of laravel migration: https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Migrations/stubs/create.stub

@quetzyg
Copy link
Contributor

quetzyg commented Sep 17, 2018

If you have that specific need, do the change on the applications using this package. Like stated in the documentation, there's plenty of customisations that you can perform in your migration, but they don't necessarily have to be included by default.

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.

None yet

2 participants