Module: DataMapper::Repository::Migration

Included in:
DataMapper::Repository
Defined in:
lib/gems/dm-core-0.9.9/lib/dm-core/repository.rb

Overview

TODO: move to dm-more/dm-migrations

Instance Method Summary collapse

Instance Method Details

#auto_migrate!Object

TODO: move to dm-more/dm-migrations



138
139
140
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/repository.rb', line 138

def auto_migrate!
  AutoMigrator.auto_migrate(name)
end

#auto_upgrade!Object

TODO: move to dm-more/dm-migrations



143
144
145
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/repository.rb', line 143

def auto_upgrade!
  AutoMigrator.auto_upgrade(name)
end

#map(*args) ⇒ Object

TODO: move to dm-more/dm-migrations



114
115
116
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/repository.rb', line 114

def map(*args)
  type_map.map(*args)
end

#migrate!Object

TODO: move to dm-more/dm-migrations



133
134
135
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/repository.rb', line 133

def migrate!
  Migrator.migrate(name)
end

#storage_exists?(storage_name) ⇒ True, False

TODO: move to dm-more/dm-migrations

Returns:

  • (True, False)

    whether or not the data-store exists for this repo



128
129
130
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/repository.rb', line 128

def storage_exists?(storage_name)
  adapter.storage_exists?(storage_name)
end

#type_mapObject

TODO: move to dm-more/dm-migrations



119
120
121
# File 'lib/gems/dm-core-0.9.9/lib/dm-core/repository.rb', line 119

def type_map
  @type_map ||= TypeMap.new(adapter.class.type_map)
end