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.1] Force database migration to use the writePdo #18882

Merged
merged 1 commit into from
Apr 20, 2017

Conversation

PGBI
Copy link
Contributor

@PGBI PGBI commented Apr 20, 2017

This PR aims at preventing a bug we faced when running migrations before deploying our application on production. We have in our infrastructure a master mysql table and several slaves which replicate master.

Here is what happened:

  • we added a migration file, and run php artisan migrate on our server => Success
  • we added a second migration file, and run php artisan migrate => Error

The error occurred because Laravel attempted to run the first migration file again.

It turned out one of the slave db had an abnormal replication delay, and was unaware yet of the first migration.

This PR aims at making sure Laravel checks on master and not on a slave which migrations must be run on php artisan migrate.

@taylorotwell taylorotwell merged commit 1cdfd6d into laravel:5.1 Apr 20, 2017
@PGBI PGBI deleted the database_migration_write_pdo branch April 20, 2017 12:43
@PGBI
Copy link
Contributor Author

PGBI commented Apr 20, 2017

@taylorotwell Thanks for merging this. I'm not familiar with laravel releases workflow. I opened this PR against the 5.1 branch as instructed by the contribution guide, but we are currently using laravel 5.2.

Will this fix be cascaded to the subsequent laravel releases, or should I open the same PR against the 5.2 branch?

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.

2 participants