Sha256: a754356817a1113c9a5f9fbe67d8501c8c74cfc718f09269651eaf71e2e72d50

Contents?: true

Size: 1016 Bytes

Versions: 1

Compression:

Stored size: 1016 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', '0.10.2'
      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

1 entries across 1 versions & 1 rubygems

Version Path
rails_datamapper-0.10.2 generators/dm_install/templates/datamapper.rake