Skip to content

Conversation

ghostwriter
Copy link
Contributor

@ghostwriter ghostwriter commented Sep 13, 2020

Currently:

If you run php artisan blueprint:build more than once, without the -m|--overwrite-migrations flag, Blueprint will generate duplicate migrations with different timestamps.

If you then run php artisan blueprint:build -m or php artisan blueprint:build --overwrite-migrations, Blueprint will overwrite ONLY the first migration file it finds. All other duplicate migrations with different timestamps will still exist.

PR:

  1. Running php artisan blueprint:build

    • Blueprint will still generate duplicate migrations with different timestamps with php artisan blueprint:build (for comparison,testing, etc.)
  2. Running php artisan blueprint:build -m or php artisan blueprint:build --overwrite-migrations

    • Blueprint will update the oldest existing migration file.
    • Removes all other duplicate migrations with different timestamps.
    • Reports deleted files
      image

Nathan E added 3 commits September 13, 2020 14:24
@jasonmccreary jasonmccreary merged commit 71a4f57 into laravel-shift:master Sep 17, 2020
@ghostwriter ghostwriter deleted the bugfix/overwrite/remove-duplicate-migration-files branch September 17, 2020 21:53
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.

Option to overwrite duplicate migration files
2 participants