fix migration to fill the updated_at column. The rss feeds need a filled column. Fixes #794

This commit is contained in:
Reinier Balt 2008-11-26 10:53:00 +01:00
parent 49f9f33ac0
commit 764e41685b

View file

@ -1,8 +1,10 @@
class AddUpdatedAtToTodos < ActiveRecord::Migration
def self.up
add_column :todos, :updated_at, :timestamp
end
def self.down
remove_column :todos, :updated_at
end
end
execute 'update todos set updated_at = created_at where completed_at IS NULL'
execute 'update todos set updated_at = completed_at where NOT completed_at IS NULL'
end
def self.down
remove_column :todos, :updated_at
end
end