Rob Morris wrote: > Having just taken the plunge and updated my old 2.0.2 site to 2.3.5 with > all the trimmings, I can offer a few thoughts. > > The latest engines plugin does handle legacy migrations, but you need to > do some tweaking. > > First off, you need to set Rails to use numeric migrations, or you'll > have lots of headaches. Alternately, I suppose you can manually > timestamp your old migrations, but I haven't tried that one yet... You > can set Rails to use numeric migrations by setting: > config.active_record.timestamped_migrations = false > > Once that's done, you need (possibly) to run: rake > db:migrate:upgrade_plugin_migration > > This will make sure you have the proper DB tables, and put an entry into > that table for every old plugin migrations you have, in the format > "<#>-<plugin-name>" > > At this point, you should be in good shape. Your db state matches your > code state, with one entry in schema_migrations for every plugin > migration and every main app migration. > > The final trick is to use: rake db:migrate:all > > Use this to upgrade your DB instead of the old ./script/generate > plugin_migration bit. The engines plugin will run all existing plugins, > find all new migrations, and apply them correctly. > > Hope that helps! > > -Rob
That does help and I think I'll go with that. I've found you can run rake db:migrate:plugin NAME=pluginname and it runs fine. The only issue I can't seem to solve is how to back out migrations applied in this way. Have you any guidance there? Doesn't look like there's any sort of rake db:migrate:plugin:down ...wondering if there should be? -- Posted via http://www.ruby-forum.com/. _______________________________________________ Engine-Users mailing list [email protected] http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org
