Just remove the migration files themselves or make new migration files to remove the columns/tables.
On Dec 3, 6:55 pm, Shantanu Pavgi <[EMAIL PROTECTED]> wrote: > Well, I need to remove some database tables from my application. So I am > using rake db:migrate:down to undo/remove migrations. Also, I have > changed (added/removed/modified) the code in model, view, controller, > and tests to make these changes. Now I need to run tests in order to > check everything is working. > > I can pull out an old copy from revision control system. But, what if > migrations that need to be removed are not the latest ones. Lets assume > that there are 30 > migrations. > - migration # 15 and 17 - are related to adding new tables > - migration # 22 and 25 - add column to above tables. > > So I need to remove/undo migrations 15, 17, 22, and 25. I need other > migrations as they are not related to these tables. What should I do in > such situation? > > I did db:migrate:down for above migrations and also made necessary > changes in the code and now trying to run tests. Am I following wrong > approach? > > Thanks, > Shantanu. > > > > James Mitchell wrote: > > That's an unusual question. The reason you have tests is to verify > > your code actually does what you think it's doing. If you migrate > > down, you add and/or remove model attributes, which (hopefully) your > > code depends on. And your tests should fail if you change that. That > > is, if your code doesn't break just trying to run the tests. > > > Are your trying to run a prior version of your app? If so, you should > > use your revision control system to pull down an older copy of the > > code and db:reset. > > > HTH > > > On 12/3/08, Shantanu Pavgi <[EMAIL PROTECTED]> wrote: > > > -- > > > -- > > James Mitchell > > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---