Mina::DataMigrate
Plugin for Mina that adds support for data migrations
Installation & Usage
Add this line to your application's Gemfile:
gem 'mina-data-migrate', require: false
And then execute:
$ bundle
Require mina/data-migrate
in your config/deploy.rb
:
require 'mina/data_migrate'
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
...
task setup: :environment do
...
end
desc 'Deploys the current version to the server.'
task deploy: :environment do
...
end
Update deploy task:
# config/deploy.rb
desc 'Deploys the current version to the server.'
task deploy: :environment do
...
# remove this line
# invoke :'rails:db_migrate'
# add new task
invoke :'rails:db_data_migrate'
...
end
Configuration
-
data_migration_dirs
- array of dirs with data migrations (['db/data'] by default)
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request