mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 20:08:51 +01:00
fix migration to fill the updated_at column. The rss feeds need a filled column. Fixes #794
This commit is contained in:
parent
49f9f33ac0
commit
764e41685b
1 changed files with 7 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue