This project, and all others in projecthydra-deprecated, have been deprecated and are no longer actively maintained by the Hydra Project developer community. See the Hydra Project's main Github page at projecthydra for projects that are actively maintained.
Original README is below
Simple migrations for Hydra models
Add this line to your application's Gemfile:
gem 'hydra-migrate', :require => false
And then execute:
$ bundle
Or install it yourself as:
$ gem install hydra-migrate
class MyModel < ActiveFedora::Base
include Hydra::ModelMixins::Migratable
# ... other model code here ...
end
class MyModelMigration < Hydra::Migrate::Migration
migrate nil => 1 do |object,version,dispatcher|
# Do stuff to object to get it from unknown version to v1
end
migrate 1 => 2 do |object,version,dispatcher|
# Do stuff to object to get it from v1 to v2
end
end
class MyExplicitModelMigration < Hydra::Migrate::Migration
migrates MyModel
migrate nil => 1 do |object,version,dispatcher|
# Do stuff to object to get it from unknown version to v1
end
migrate 1 => 2 do |object,version,dispatcher|
# Do stuff to object to get it from v1 to v2
end
end
# Migrate everything that can be migrated
$ rake hydra:migrate
# Migrate one particular class of objects
$ rake hydra:migrate models=MyModel
# Target a specific version
$ rake hydra:migrate to=3
- Reversible migrations (rollback)
- Improved rake task(s):
- Migrate specific object, not entire model class
See CONTRIBUTING.md