Add data consistency migrations
This commit is contained in:
parent
858ec0f548
commit
6a404cdbe9
|
@ -0,0 +1,12 @@
|
|||
class EventType < ActiveRecord::Base
|
||||
end
|
||||
|
||||
class SetMinimalAndMaximalTimesForAllEventTypes < ActiveRecord::Migration
|
||||
def up
|
||||
EventType.where(minimum_length: nil).update_all(minimum_length: 0)
|
||||
EventType.where(maximum_length: nil).update_all(maximum_length: 240)
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
class Event < ActiveRecord::Base
|
||||
end
|
||||
|
||||
class AddDescriptionsForAllEvents < ActiveRecord::Migration
|
||||
def up
|
||||
Event.where(description: [nil, '']).update_all(description: 'n/a')
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue