Re: [Engine-Users] The state of Rails 2.3 / Engines migrations Rob Morris Tue Feb 09 14:00:51 2010Having 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:allUse 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 On 2/9/2010 4:43 PM, seth b wrote:
Hey everyone, I've been out of the loop for a minute regarding engines, but I'm looking to update Substruct to Engines 2.3/Rails 2.3 if possible. My last investigation stopped when running into the migrations issue. I'm wondering if there is a recommended way to handle engine migrations / legacy migrations (001_my_migration.rb) with 2.3. The official site mentions some "things being in the works" but I didn't really see anything past that. Any advice or a link to a blog post would be cool. Thanks much. -------------------- http://subimage.com http://twitter.com/subimage _______________________________________________ Engine-Users mailing list [EMAIL PROTECTED] http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org
_______________________________________________ Engine-Users mailing list [EMAIL PROTECTED] http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org
- [Engine-Developers] The state of Rails 2.3 / Engines migrations seth b 2010/02/09
- Re: [Engine-Developers] The state of Rails 2.3 / Engines migrations Nat Budin 2010/02/09
- Re: [Engine-Users] The state of Rails 2.3 / Engines migrations Rob Morris 2010/02/09 <=
- Re: [Engine-Users] The state of Rails 2.3 / Engines migrations Roger Pack 2010/02/11