On Mar 11, 2009, at 4:04 PM, James Adam wrote:
> The two key features missing from the 'engines' support in Rails 2.3
> are migrations and public assets; the latter isn't too hard to handle
> for plugins themselves, but migrations are a bit trickier, so I'm
> really keen to get something into core that is simple and consistent.
>
> Luca Guidi has done some great work around this, but unfortunately,
> it's a tricky problem. I've used the discussion here (http://
> interblah.net/plugin-migrations) to clarify my own thoughts, and
> hopefully others will find it useful. The two key problems are
> maintaining the timeline (so that rollback is consistent), and
> detecting which migrations have already been run.
>
> I've attached what I believe to be the simplest, least-intrusive
> implementation I can think of to the ticket -
> http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/2058-rake-tasks-for-run-engine-migrations#ticket-2058-22
>
> Please take a look, and let me know what you think.
>
> James


Pivotal Labs' Desert system does a lot of what Engines does, though  
somewhat differently in places.  It has a pretty simple system for  
doing migrations from plugins, and the code is open source.

http://github.com/pivotal/desert

Look in desert/lib/desert/plugin_migrations

Desert creates a parallel table for plugin migrations:  
plugin_schema_migrations.  It's like the app's schema_migrations  
table, but each row has both a version and a plugin name.  Migrations  
in plugins are accessed by putting a method call in an app migration  
that migrates to a particular migration version in the plugin - it's  
not automagic, but it works quite well.

This would probably work fine to manage migrations in Rails Engine  
plugins too.

--
Josh Susser
http://blog.hasmanythrough.com
Golden Gate Ruby Conf :: April 17-18 :: http://gogaruco.com




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to