Class: DataMapper::Migration

Inherits:
Object
  • Object
show all
Includes:
SQL
Defined in:
lib/mack-data_mapper/dm_patches/migrations.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#perform_downObject

un-do the migration by running the code in the #down block



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mack-data_mapper/dm_patches/migrations.rb', line 65

def perform_down
  result = nil
  if needs_down?
    # database.transaction.commit do
      say_with_time "== Performing Down Migration ##{position}: #{name}", 0 do
        result = @down_action.call
      end
      update_migration_info(:down)
    # end
  end
  result
end

#perform_upObject

perform the migration by running the code in the #up block



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/mack-data_mapper/dm_patches/migrations.rb', line 51

def perform_up
  result = nil
  if needs_up?
    # database.transaction.commit do
      say_with_time "== Performing Up Migration ##{position}: #{name}", 0 do
        result = @up_action.call
      end
      update_migration_info(:up)
    # end
  end
  result
end