Make migrations reversible
While I don't use this feature, there are developers who do. It's useful when running migrations and changing branches. I'm raising an `ActiveRecord::IrreversibleMigration` exception in every `drop_table` migration because these migrations were all done before version 1.0.0, and so making all of them reversible would be too much work for little benefit.
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
class AddTimeZoneToDefaultDatetimes < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column_default :users, :password_changed_at, DateTime.new(2015, 1, 1, 1, 1, 1, "+00:00")
|
||||
change_column_default :locks, :locked_until, DateTime.new(2000, 1, 1, 1, 1, 1, "+00:00")
|
||||
change_column_default :users, :password_changed_at,
|
||||
from: Time.zone.local(2015, 1, 1, 1, 1, 1),
|
||||
to: DateTime.new(2015, 1, 1, 1, 1, 1, "+00:00")
|
||||
|
||||
change_column_default :locks, :locked_until,
|
||||
from: Time.zone.local(2000, 1, 1, 1, 1, 1),
|
||||
to: DateTime.new(2000, 1, 1, 1, 1, 1, "+00:00")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user