32

The command rake db:migrate will apply all relevant new migrations to a database and will list in the output the migrations that were applied.

I'd like to know in advance what migrations will be applied so as to note down a list of the changes that are expected in a production environment.

Is there an option I can use in conjunction to rake db:migrate that will show me what changes will be applied without actually applying them?

Jon Cram
  • 16,609
  • 24
  • 76
  • 107

2 Answers2

63

Does rake db:migrate:status (rails 3+ only) fit the bill?

Bradley Priest
  • 7,438
  • 1
  • 29
  • 33
Benoit Garret
  • 14,027
  • 4
  • 59
  • 64
0

I guess here's the answer: Show pending migrations in rails .

If you are deploying with capistarno, you could add a task similar to this: http://gem-session.com/2010/08/warn-of-pending-migrations-when-deploying-with-capistrano .

Community
  • 1
  • 1
santuxus
  • 3,662
  • 1
  • 29
  • 35