Sha256: 95f36cb518ab39c226f4d288f0a52d5fdd71d7bcba1c7aab74f08249b274e98e
Contents?: true
Size: 1006 Bytes
Versions: 3
Compression:
Stored size: 1006 Bytes
Contents
namespace :db do desc "Perform automigration" task :automigrate => :environment do FileList["app/models/**/*.rb"].each do |model| load model end ::DataMapper.auto_migrate! end desc "Perform non destructive automigration" task :autoupgrade => :environment do FileList["app/models/**/*.rb"].each do |model| load model end ::DataMapper.auto_upgrade! end namespace :migrate do task :load => :environment do gem 'dm-migrations' FileList["db/migrations/*.rb"].each do |migration| load migration end end desc "Migrate up using migrations" task :up, :version, :needs => :load do |t, args| version = args[:version] migrate_up!(version) end desc "Migrate down using migrations" task :down, :version, :needs => :load do |t, args| version = args[:version] migrate_down!(version) end end desc "Migrate the database to the latest version" task :migrate => 'db:migrate:up' end
Version data entries
3 entries across 3 versions & 2 rubygems