plugin_migrations
plugin_migrations
adds support for plugin-based migrations.
Resources
Announcement
Wiki
API
Development
Source
Description
In addition to the normal schema_info table that Rails created in your database to keep track of the current migration version, this plugin adds a new table called plugin_schema_info:
plugin_schema_info
------------------
plugin_name (string)
version (integer)
Plugin migrations expects the migrations to be located in a similar directory structure as that of your Rails application. That is, it would look in /db/migrate in your plugin’s folder.
Usage
The plugin can be used via the new rake tasks that have been added. The plugins which are migrated are based on what is stored in Rails.plugins
. For more information on this attributes, see the loaded_plugins plugin.
db:migrate:plugins
Running db:migrate:plugins
will run the migrations for every plugin that is loaded. You can also specify exactly which plugin you want to migrate.
Examples:
Assuming the following directory structure:
vendor/
vendor/plugins/
vendor/plugins/acts_as_bunny/
vendor/plugins/acts_as_as_chicken/
rake db:migrate:plugins # Migrates both acts_as_bunny and acts_as_chicken
rake db:migrate:plugins PLUGIN=acts_as_bunny
rake db:migrate:plugins PLUGIN=acts_as_bunny VERSION=2
db:fixtures:load:plugins
Running db:fixtures:load:plugins
will load the fixtures for every plugin that is loaded. You can also specify exactly which plugin you want to load fixtures for.
Examples:
Assuming the following directory structure:
vendor/
vendor/plugins/
vendor/plugins/acts_as_bunny/
vendor/plugins/acts_as_as_chicken/
rake db:fixtures:load:plugins # Loads fixtures for both acts_as_bunny and acts_as_chicken
rake db:fixtures:load:plugins PLUGIN=acts_as_bunny
rake db:fixtures:load:plugins PLUGIN=acts_as_bunny FIXTURES=bunnies
rake db:fixtures:load:plugins PLUGIN=acts_as_bunny FIXTURES=bunnies,rabbits
Testing
Before you can run any tests, the following gems must be installed:
Dependencies
This plugin dependencies on the presence of the following plugins:
References
-
James Adam - Engines