Migrations are publishable, they don't need to be loaded #255
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request attempts to fix an issue identified in the comments of my previous PR, where the Eloquent Driver's migrations were being loaded, even though they had already been published and the tables already existed.
Since the filenames of migrations changed in #253, Laravel thought the migrations it was loading directly from the package's
database/migrationsdirectory were new migrations so it attempted to run them causing an error.To make it easier to understand, here's what lead to the error happening:
php artisan vendor:publishdatabase/migrations.vendor:publishcommand multiple times.php artisan migratemigratecommand, Laravel not only looks at your project'sdatabase/migrationsdirectory but it also looks at any "migration paths" registered by packages (it's what theloadMigrationsFrommethod does).database/migrationsdirectory and due to the filename changes made in Prevent migrations being published multiple times #253, it thought they were new migrations so it attempted to run them, only to cause an error because they had already been published & run.Since we recommend developers publish the migrations anyway, there's no issue in us stopping to load migrations, so this PR does that by removing the line which calls
loadMigrationsFrom.I've compared this to how Laravel Pulse, a first-party Laravel package, handles migrations. They just let developers publish the migrations instead of "forcibly" loading them.