Migration checker checked in

1 view
Skip to first unread message

Bryan Stearns

unread,
Apr 9, 2008, 4:49:03 PM4/9/08
to pdx-tech...@googlegroups.com
I just checked in an initializer that checks that the highest-numbered
migration in db/migrate has been applied; it'll give you a nice error
(and refuse to run) if an "svn update" gets you a new migration, but you
don't notice or forget to apply it.

(It doesn't do anything if run from Rake [so rake db:migrate still
works!], and if you have other circumstances where you don't want its
protection, you can define NO_MIGRATION_CHECK on the command line - I
have a couple of capistrano tasks that use this.)

...Bryan

Igal Koshevoy

unread,
Apr 10, 2008, 5:30:15 AM4/10/08
to pdx-tech...@googlegroups.com
Bryan Stearns wrote:
> I just checked in an initializer that checks that the highest-numbered
> migration in db/migrate has been applied; it'll give you a nice error
> (and refuse to run) if an "svn update" gets you a new migration, but you
> don't notice or forget to apply it.
>
I've been using your initializer on another project and have been
meaning to add it to Calagator. Thanks for checking it in.

-igal

Reply all
Reply to author
Forward
0 new messages