2014-09-02 18:07:02 +05:30
|
|
|
class UserColorScheme < ActiveRecord::Migration
|
2016-06-02 11:05:42 +05:30
|
|
|
include Gitlab::Database
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
def up
|
|
|
|
add_column :users, :color_scheme_id, :integer, null: false, default: 1
|
2016-06-02 11:05:42 +05:30
|
|
|
execute("UPDATE users SET color_scheme_id = 2 WHERE dark_scheme = #{true_value}")
|
2014-09-02 18:07:02 +05:30
|
|
|
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
|