Module Mack::Database::Migrations
In: lib/mack-active_record/database_migrations.rb

Methods

Public Class methods

Not implemented

[Source]

    # File lib/mack-active_record/database_migrations.rb, line 19
19:       def self.abort_if_pending_migrations
20:       end

Migrates the database to the latest version

[Source]

   # File lib/mack-active_record/database_migrations.rb, line 6
6:       def self.migrate
7:         ActiveRecord::Migrator.up(Mack::Paths.db("migrations"))
8:       end

Rolls back the database by the specified number of steps. Default is 1

[Source]

    # File lib/mack-active_record/database_migrations.rb, line 11
11:       def self.rollback(step = 1)
12:         cur_version = version.to_i
13:         target_version = cur_version - step 
14:         target_version = 0 if target_version < 0
15:         ActiveRecord::Migrator.down(Mack::Paths.db("migrations"), target_version)
16:       end

Returns the current version of the database

[Source]

    # File lib/mack-active_record/database_migrations.rb, line 23
23:       def self.version
24:         ActiveRecord::Migrator.current_version
25:       end

[Validate]