add default dates for upsert
This commit is contained in:
parent
0946cb124c
commit
db6a2e6ff1
|
@ -9,6 +9,8 @@ class CreateVotes < ActiveRecord::Migration[6.0]
|
|||
|
||||
t.timestamps
|
||||
end
|
||||
change_column_default :votes, :created_at, from: nil, to: ->{ 'now()' }
|
||||
change_column_default :votes, :updated_at, from: nil, to: ->{ 'now()' }
|
||||
add_index :votes, [:user_id, :election_slug], unique: true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue