Sha256: 280efd1b2e42bd69a1ac720a6819eb58100327266cee3ec014c1d5f14bd74e59

Contents?: true

Size: 659 Bytes

Versions: 14

Compression:

Stored size: 659 Bytes

Contents

module Apartment
  
  module Migrator
    
    extend self
  
    # Migrate to latest
		def migrate(database)
			Database.process(database){ ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_path) }
		end
	
    # Migrate up/down to a specific version
		def run(direction, database, version)
		  Database.process(database){ ActiveRecord::Migrator.run(direction, ActiveRecord::Migrator.migrations_path, version) }
	  end
  
    # rollback latest migration `step` number of times
		def rollback(database, step = 1)
		  Database.process(database){ ActiveRecord::Migrator.rollback(ActiveRecord::Migrator.migrations_path, step) }
	  end
  end
	  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
apartment-0.13.0.1 lib/apartment/migrator.rb
apartment-0.13.1 lib/apartment/migrator.rb
apartment-0.13.0 lib/apartment/migrator.rb
apartment-0.12.0 lib/apartment/migrator.rb
apartment-0.11.1 lib/apartment/migrator.rb
apartment-0.11.0 lib/apartment/migrator.rb
apartment-0.10.3 lib/apartment/migrator.rb
apartment-0.10.2 lib/apartment/migrator.rb
apartment-0.10.1 lib/apartment/migrator.rb
apartment-0.10.0 lib/apartment/migrator.rb
apartment-0.9.2 lib/apartment/migrator.rb
apartment-0.9.1 lib/apartment/migrator.rb
apartment-0.9.0 lib/apartment/migrator.rb
apartment-0.8.0 lib/apartment/migrator.rb