-
Notifications
You must be signed in to change notification settings - Fork 11.7k
feat: add check for existing migration before creation #57023
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
Conversation
Added a check to detect existing migrations and prevent creating duplicates, regardless of the timestamp.
|
Hi 👋 I hope my contribution will be useful, thank you! 🙏 |
|
This might work for CREATE migrations but less so for UPDATE ones. This would require verbose naming sometimes. So if this is considered to be supported, there has to be an opt-in mechanism. |
|
Thank you for your attention! For example:
This way, each migration clearly describes the specific change it introduces. Thanks again for your time and review! 🙏 |
|
Is that for you to decide? Just make it a warning and let people decide themselves what works best for them. |
src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php
Outdated
Show resolved
Hide resolved
src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php
Outdated
Show resolved
Hide resolved
src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php
Outdated
Show resolved
Hide resolved
src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php
Outdated
Show resolved
Hide resolved
src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php
Outdated
Show resolved
Hide resolved
|
Thanks for your review and guidance. I’ve made all the updates and hope I got it right. |
|
Looks good—thanks 👍🏻 |
|
Hi! 😊 |
|
there's not necessarily anything wrong with the code, usually means he doesn't want this feature in the framework. |
|
Got it, thanks! |
Added a warning that the migration name already exists and included the
--check-duplicateoption to prevent creating duplicate migrations with the same name, regardless of the timestamp.