Module Mack::Database::Migrator
In: lib/database.rb

Methods

migrate   rollback   version  

Public Class methods

[Source]

    # File lib/database.rb, line 16
16:       def self.migrate
17:         ActiveRecord::Migrator.up(File.join(Mack.root, "db", "migrations"))
18:       end

[Source]

    # File lib/database.rb, line 20
20:       def self.rollback(step = 1)
21:         step = (ENV["STEP"] || step).to_i
22:         cur_version = version.to_i
23:         target_version = cur_version - step 
24:         target_version = 0 if target_version < 0
25:         
26:         ActiveRecord::Migrator.down(File.join(Mack.root, "db", "migrations"), target_version)
27:       end

[Source]

    # File lib/database.rb, line 12
12:       def self.version
13:         ActiveRecord::Migrator.current_version
14:       end

[Validate]