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