Module | Mack::Database::Migrator |
In: |
lib/database.rb
|
# File lib/database.rb, line 16 16: def self.migrate 17: ActiveRecord::Migrator.up(File.join(Mack.root, "db", "migrations")) 18: end
# 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