]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/025_add_end_time_to_changesets.rb
Avoid deprecation warning in migration
[rails.git] / db / migrate / 025_add_end_time_to_changesets.rb
index 20d66719df800384a2a708a83cdda4b0fcb172ee..32d27959a44cc212813d8383b116fdfa84251af6 100644 (file)
@@ -1,4 +1,4 @@
-require 'lib/migrate'
+require 'migrate'
 
 class AddEndTimeToChangesets < ActiveRecord::Migration
   def self.up
@@ -9,8 +9,8 @@ class AddEndTimeToChangesets < ActiveRecord::Migration
     # it appears that execute will only accept string arguments, so
     # this is an ugly, ugly hack to get some sort of mysql/postgres
     # independence. now i have to go wash my brain with bleach.
-    execute("update changesets set closed_at=(now()-#{interval_constant('1 hour')}) where open=(1=0)")
-    execute("update changesets set closed_at=(now()+#{interval_constant('1 hour')}) where open=(1=1)")
+    execute("update changesets set closed_at=(now()-'1 hour'::interval) where open=(1=0)")
+    execute("update changesets set closed_at=(now()+'1 hour'::interval) where open=(1=1)")
 
     # remove the open column as it is unnecessary now and denormalises 
     # the table.