Module: DataMapper::Migrations::Repository

### Home Classes Methods

### In Files

- lib/dm-migrations/auto_migration.rb

### Methods

- #auto_migrate!
- #auto_upgrade!
- #create_model_storage
- #destroy_model_storage
- #storage_exists?
- #upgrade_model_storage

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Adapters
- DataMapper::Migration
- DataMapper::MigrationRunner
- DataMapper::Migrations
- DataMapper::Migrations::DataObjectsAdapter
- DataMapper::Migrations::DataObjectsAdapter::ClassMethods
- DataMapper::Migrations::DuplicateMigration
- DataMapper::Migrations::Model
- DataMapper::Migrations::MysqlAdapter
- DataMapper::Migrations::MysqlAdapter::ClassMethods
- DataMapper::Migrations::OracleAdapter
- DataMapper::Migrations::OracleAdapter::ClassMethods
- DataMapper::Migrations::PostgresAdapter
- DataMapper::Migrations::PostgresAdapter::ClassMethods
- DataMapper::Migrations::Repository
- DataMapper::Migrations::SingletonMethods
- DataMapper::Migrations::SqliteAdapter
- DataMapper::Migrations::SqliteAdapter::ClassMethods
- DataMapper::Migrations::SqlserverAdapter
- DataMapper::Migrations::SqlserverAdapter::ClassMethods
- DataMapper::Migrations::YamlAdapter
- SQL
- SQL::Column
- SQL::Mysql
- SQL::Mysql::Column
- SQL::Mysql::Table
- SQL::Postgres
- SQL::Postgres::Column
- SQL::Postgres::Table
- SQL::Sqlite
- SQL::Sqlite::Column
- SQL::Sqlite::Table
- SQL::Table
- SQL::TableCreator
- SQL::TableCreator::Column
- SQL::TableCreator::SqlExpr
- SQL::TableModifier
- Spec
- Spec::Example
- Spec::Example::MigrationExampleGroup
- Spec::Matchers
- Spec::Matchers::Migration
- Spec::Matchers::Migration::HaveColumnMatcher
- Spec::Matchers::Migration::HaveTableMatcher
- Spec::Matchers::Migration::NullableColumnMatcher
- Spec::Matchers::Migration::PrimaryKeyMatcher
- Object

No matching classes.

# DataMapper::Migrations::Repository

### Public Instance Methods

auto_migrate!() click to toggle source

Destructively automigrates the data-store to match the model. First migrates all models down and then up. REPEAT: THIS IS DESTRUCTIVE

@api public

    # File lib/dm-migrations/auto_migration.rb, line 98
    def auto_migrate!
      DataMapper.auto_migrate!(name)
    end

auto_upgrade!() click to toggle source

Safely migrates the data-store to match the model preserving data already in the data-store

@api public

    # File lib/dm-migrations/auto_migration.rb, line 106
    def auto_upgrade!
      DataMapper.auto_upgrade!(name)
    end

create_model_storage(model) click to toggle source

@api semipublic

    # File lib/dm-migrations/auto_migration.rb, line 78
    def create_model_storage(model)
      adapter = self.adapter
      if adapter.respond_to?(:create_model_storage)
        adapter.create_model_storage(model)
      end
    end

destroy_model_storage(model) click to toggle source

@api semipublic

    # File lib/dm-migrations/auto_migration.rb, line 86
    def destroy_model_storage(model)
      adapter = self.adapter
      if adapter.respond_to?(:destroy_model_storage)
        adapter.destroy_model_storage(model)
      end
    end

storage_exists?(storage_name) click to toggle source

Determine whether a particular named storage exists in this repository

@param [String]

    storage_name name of the storage to test for

@return [Boolean]

    true if the data-store +storage_name+ exists

@api semipublic

    # File lib/dm-migrations/auto_migration.rb, line 62
    def storage_exists?(storage_name)
      adapter = self.adapter
      if adapter.respond_to?(:storage_exists?)
        adapter.storage_exists?(storage_name)
      end
    end

upgrade_model_storage(model) click to toggle source

@api semipublic

    # File lib/dm-migrations/auto_migration.rb, line 70
    def upgrade_model_storage(model)
      adapter = self.adapter
      if adapter.respond_to?(:upgrade_model_storage)
        adapter.upgrade_model_storage(model)
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.