mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
also update sql in migration for mysql4 users
This commit is contained in:
parent
324838c1c4
commit
af711c2568
1 changed files with 1 additions and 1 deletions
|
|
@ -2,7 +2,7 @@ class AddUpdatedAtToTodos < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
add_column :todos, :updated_at, :timestamp
|
add_column :todos, :updated_at, :timestamp
|
||||||
execute 'update todos set updated_at = created_at where completed_at IS NULL'
|
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'
|
execute 'update todos set updated_at = completed_at where NOT (completed_at IS NULL)'
|
||||||
end
|
end
|
||||||
def self.down
|
def self.down
|
||||||
remove_column :todos, :updated_at
|
remove_column :todos, :updated_at
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue