Module: DataMapper::Migrations::SingletonMethods

Defined in:
lib/dm-core/migrations.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



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

def auto_migrate!(repository_name = nil)
  auto_migrate_down!(repository_name)
  auto_migrate_up!(repository_name)
end

#auto_upgrade!(repository_name = nil) ⇒ Object

TODO: document



27
28
29
# File 'lib/dm-core/migrations.rb', line 27

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



11
12
13
# File 'lib/dm-core/migrations.rb', line 11

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