How to update migration during upgrade using Rails 1.2.3 application?

I am upgrading a Rails 1.2.3 application to 3.2.1.

I'm trying to figure out how I can update the migration structure so that it is compatible with the latest version of Rails, so ideally you can just run it rake db:migratewhen you configure the application. I have currently solved this by simply performing rake db:migrate:up VERSION=[version_number]any migration I need to run. If I just started rake db:migrate, it will try to restart all migrations from the very beginning and stop (since these migrations are already being done in the db dump that I have).

Migration in the annex are as follows: 001_add_some_model.rb, 002_add_some_other_model.rbinstead 20120209182512_add_some_model.rb.

Does anyone have any experience? How can i fix this?

+5
source share
3 answers

I think you should restart your migrations, delete all your migrations and create a new migration with the definitions of your current models. See this migration for an initial example .

+7
source

It is not recommended to run all migrations to configure a new database even in the updated Rails 3 application. This is explained in db / schema.rb:

, schema.rb . , db: schema: load, . ( , ).

+2

, , . , , , .

, , .

.

0

All Articles