Module: Mack::Database::Migrations
- Defined in:
- lib/mack-orm/database_migrations.rb
Class Method Summary collapse
- .abort_if_pending_migrations ⇒ Object
-
.migrate ⇒ Object
Migrates the database to the latest version.
-
.migration_files ⇒ Object
Returns a list of the all migration files.
-
.rollback(step = 1) ⇒ Object
Rolls back the database by the specified number of steps.
-
.version ⇒ Object
Returns the current version of the database.
Class Method Details
.abort_if_pending_migrations ⇒ Object
15 16 17 |
# File 'lib/mack-orm/database_migrations.rb', line 15 def self.abort_if_pending_migrations raise NoMethodError.new(:abort_if_pending_migrations) end |
.migrate ⇒ Object
Migrates the database to the latest version
6 7 8 |
# File 'lib/mack-orm/database_migrations.rb', line 6 def self.migrate raise NoMethodError.new(:migrate) end |
.migration_files ⇒ Object
Returns a list of the all migration files.
25 26 27 |
# File 'lib/mack-orm/database_migrations.rb', line 25 def self.migration_files Dir.glob(Mack::Paths.migrations("*.rb")) end |
.rollback(step = 1) ⇒ Object
Rolls back the database by the specified number of steps. Default is 1
11 12 13 |
# File 'lib/mack-orm/database_migrations.rb', line 11 def self.rollback(step = 1) raise NoMethodError.new(:rollback) end |
.version ⇒ Object
Returns the current version of the database
20 21 22 |
# File 'lib/mack-orm/database_migrations.rb', line 20 def self.version raise NoMethodError.new(:version) end |