Chore: Add default value for label color (#981)
This commit is contained in:
11
db/migrate/20200625154254_add_default_value_to_color.rb
Normal file
11
db/migrate/20200625154254_add_default_value_to_color.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class AddDefaultValueToColor < ActiveRecord::Migration[6.0]
|
||||
def up
|
||||
Label.where(color: nil).find_each { |u| u.update(color: '#1f93ff') }
|
||||
|
||||
change_column :labels, :color, :string, default: '#1f93ff', null: false
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :labels, :color, :string, default: nil, null: true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user