Chore: Add default value for label color (#981)

This commit is contained in:
Pranav Raj S
2020-06-25 21:33:56 +05:30
committed by GitHub
parent 97ad39713b
commit 0aab717bb3
3 changed files with 14 additions and 3 deletions

View 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