1

I'm soon moving my laravel setup to AWS Opsworks. I'm wondering how you run database migrations when having multiple PHP app servers. Is it best practice to define one instance and always run migrations on it? Or is it better to run migrations on all instances and presume that laravel will take care of duplicate migrations?

brasimon
  • 769
  • 2
  • 9
  • 22
  • Possible duplicate of: http://stackoverflow.com/questions/13491536/how-do-i-run-migrations-for-a-specific-environment-in-laravel – Arda Jun 17 '14 at 11:03

1 Answers1

0

It doesn't matter which instance you run it from, as long as it runs against the same database.

Laravel will automatically keep track of what migrations have been run by querying the migrations table. Regardless of what instance originally ran those migrations, it'll always be recorded right there in the database, so it won't ever run again.

(Unless you're concerned about concurrency, which is an entirely separate subject altogether).

Joseph Silber
  • 214,931
  • 59
  • 362
  • 292