I have a situation where I've renamed a table and removed a model after
many migrations.  In prior migrations, the model is used to save default
data to db. I have a new developer who want to run migrations for the
first time, but now an error occurs because the model which sets the
data has been removed from the source.

The list of options I've thought of:

1) give SQL dump of db so he can start from current state

2) Remove migrations which set data and place into a script (and
Capistrano recipe)

3) Add model back to source, and deprecate (starting to smell bad)
     Question: What is the best method for adding a deprecation warning
on an entire model and not just it's methods?

     I'm tempted to use the following
     ----

    require 'active_support/deprecation'

     class B<  ActiveRecord::Base
         def initialize(attributes = nil)
            self
         end
         deprecate :initialize
     end
     ----

     This probably won't work because of addition of validations after
future migrations

4) modify migrations (smells really bad)
     The system has not been put into production yet, but this is not a
maintainable solution.


Thanks in advance for help,

Brett

--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby

Reply via email to