Module: DataMapper::Migrations::SingletonMethods

Defined in:
lib/dm-migrations/auto_migration.rb

Instance Method Summary collapse

Instance Method Details

#auto_migrate!(repository_name = nil) ⇒ Object

drops and recreates the repository upwards to match model definitions

Parameters:

  • name (Symbol)

    repository to act on, :default is the default



21
22
23
# File 'lib/dm-migrations/auto_migration.rb', line 21

def auto_migrate!(repository_name = nil)
  repository_execute(:auto_migrate!, repository_name)
end

#auto_upgrade!(repository_name = nil) ⇒ Object



26
27
28
# File 'lib/dm-migrations/auto_migration.rb', line 26

def auto_upgrade!(repository_name = nil)
  repository_execute(:auto_upgrade!, repository_name)
end

#migrate!(repository_name = nil) ⇒ Object

destructively migrates the repository upwards to match model definitions

Parameters:

  • name (Symbol)

    repository to act on, :default is the default



12
13
14
# File 'lib/dm-migrations/auto_migration.rb', line 12

def migrate!(repository_name = nil)
  repository(repository_name).migrate!
end