Permalink
Browse files

Re-enable transactional migrations now that the api has stabilized

  • Loading branch information...
1 parent 12ebd48 commit 6e946e376bf8b7d69340956723a69fc7f018430f @paul paul committed Sep 26, 2008
Showing with 10 additions and 10 deletions.
  1. +10 −10 dm-migrations/lib/migration.rb
@@ -53,12 +53,12 @@ def down(&block)
def perform_up
result = nil
if needs_up?
- # DataMapper.database.adapter.transaction do
- say_with_time "== Performing Up Migration ##{position}: #{name}", 0 do
- result = @up_action.call
+ database.transaction.commit do
+ say_with_time "== Performing Up Migration ##{position}: #{name}", 0 do
+ result = @up_action.call
+ end
+ update_migration_info(:up)
end
- update_migration_info(:up)
- # end
end
result
end
@@ -67,12 +67,12 @@ def perform_up
def perform_down
result = nil
if needs_down?
- # DataMapper.database.adapter.transaction do
- say_with_time "== Performing Down Migration ##{position}: #{name}", 0 do
- result = @down_action.call
+ database.transaction.commit do
+ say_with_time "== Performing Down Migration ##{position}: #{name}", 0 do
+ result = @down_action.call
+ end
+ update_migration_info(:down)
end
- update_migration_info(:down)
- # end
end
result
end

0 comments on commit 6e946e3

Please sign in to comment.