2019-05-13 18:42:57 +02:00
|
|
|
class SetNilTimestamps < ActiveRecord::Migration[5.2]
|
2007-03-30 04:36:52 +00:00
|
|
|
|
|
|
|
|
class Project < ActiveRecord::Base; end
|
2012-05-13 21:03:38 -05:00
|
|
|
|
2007-03-30 04:36:52 +00:00
|
|
|
class Context < ActiveRecord::Base; end
|
|
|
|
|
|
|
|
|
|
def self.up
|
2013-09-13 16:44:59 +02:00
|
|
|
Project.where(:created_at => nil ).each do |p|
|
2007-03-30 04:36:52 +00:00
|
|
|
Project.update( p.id, {:created_at => Time.now.utc} )
|
|
|
|
|
end
|
2013-09-13 16:44:59 +02:00
|
|
|
Project.where(:created_at => nil ).each do |p|
|
2007-03-30 04:36:52 +00:00
|
|
|
Project.update( p.id, {:updated_at => Time.now.utc} )
|
|
|
|
|
end
|
2013-09-13 16:44:59 +02:00
|
|
|
Context.where(:created_at => nil ).each do |p|
|
2007-03-30 04:36:52 +00:00
|
|
|
Context.update( p.id, {:created_at => Time.now.utc} )
|
|
|
|
|
end
|
2013-09-13 16:44:59 +02:00
|
|
|
Context.where(:created_at => nil ).each do |p|
|
2007-03-30 04:36:52 +00:00
|
|
|
Context.update( p.id, {:updated_at => Time.now.utc} )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
|
#nothing to do here...
|
|
|
|
|
end
|
|
|
|
|
end
|