Chris@909: Description: Chris@909: The plugin migration generator assists in working with schema additions Chris@909: required by plugins. Instead of running migrations from plugins directly, Chris@909: the generator creates a regular Rails migration which will be responsible Chris@909: for migrating the plugins from their current version to the latest version Chris@909: installed. Chris@909: Chris@909: This is important because the set of application migrations remains an Chris@909: accurate record of the state of the database, even as plugins are installed Chris@909: and removed during the development process. Chris@909: Chris@909: Example: Chris@909: ./script/generate plugin_migration [ ...] Chris@909: Chris@909: This will generate: Chris@909: Chris@909: RAILS_ROOT Chris@909: |- db Chris@909: |-migrate Chris@909: |- xxx_plugin_migrations.rb Chris@909: Chris@909: which contains the migrations for the given plugin(s). Chris@909: Chris@909: Chris@909: Advanced Usage: Chris@909: Chris@909: There may be situations where you need *complete* control over the migrations Chris@909: of plugins in your application, migrating a certainly plugin down to X, and Chris@909: another plugin up to Y, where neither X or Y are the latest migrations for those Chris@909: plugins. Chris@909: Chris@909: For those unfortunate few, I have two pieces of advice: Chris@909: Chris@909: 1. Why? This is a code smell [http://c2.com/xp/CodeSmell.html]. Chris@909: Chris@909: 2. Well, OK. Don't panic. You can completely control plugin migrations by Chris@909: creating your own migrations. To manually migrate a plugin to a specific Chris@909: version, simply use Chris@909: Chris@909: Engines.plugins[:your_plugin_name].migrate(version) Chris@909: Chris@909: where version is the integer of the migration this plugin should end Chris@909: up at. Chris@909: Chris@909: With great power comes great responsibility. Use this wisely.