2016-06-09 12:39:16 +00:00
|
|
|
# rubocop:disable all
|
2013-03-15 13:09:34 +00:00
|
|
|
class UserColorScheme < ActiveRecord::Migration
|
2016-04-10 13:22:58 +00:00
|
|
|
include Gitlab::Database
|
|
|
|
|
2013-03-15 13:09:34 +00:00
|
|
|
def up
|
|
|
|
add_column :users, :color_scheme_id, :integer, null: false, default: 1
|
2016-04-10 13:22:58 +00:00
|
|
|
execute("UPDATE users SET color_scheme_id = 2 WHERE dark_scheme = #{true_value}")
|
2013-03-15 13:09:34 +00:00
|
|
|
remove_column :users, :dark_scheme
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
add_column :users, :dark_scheme, :boolean, null: false, default: false
|
|
|
|
remove_column :users, :color_scheme_id
|
|
|
|
end
|
|
|
|
end
|