summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20130315124931_user_color_scheme.rb12
-rw-r--r--db/schema.rb4
2 files changed, 14 insertions, 2 deletions
diff --git a/db/migrate/20130315124931_user_color_scheme.rb b/db/migrate/20130315124931_user_color_scheme.rb
new file mode 100644
index 00000000000..fe139e32ea7
--- /dev/null
+++ b/db/migrate/20130315124931_user_color_scheme.rb
@@ -0,0 +1,12 @@
+class UserColorScheme < ActiveRecord::Migration
+ def up
+ add_column :users, :color_scheme_id, :integer, null: false, default: 1
+ User.where(dark_scheme: true).update_all(color_scheme_id: 2)
+ 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
diff --git a/db/schema.rb b/db/schema.rb
index 2250f418bdd..80c61a4fd6a 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130304105317) do
+ActiveRecord::Schema.define(:version => 20130315124931) do
create_table "events", :force => true do |t|
t.string "target_type"
@@ -258,7 +258,6 @@ ActiveRecord::Schema.define(:version => 20130304105317) do
t.string "linkedin", :default => "", :null => false
t.string "twitter", :default => "", :null => false
t.string "authentication_token"
- t.boolean "dark_scheme", :default => false, :null => false
t.integer "theme_id", :default => 1, :null => false
t.string "bio"
t.integer "failed_attempts", :default => 0
@@ -269,6 +268,7 @@ ActiveRecord::Schema.define(:version => 20130304105317) do
t.boolean "can_create_group", :default => true, :null => false
t.boolean "can_create_team", :default => true, :null => false
t.string "state"
+ t.integer "color_scheme_id", :default => 1, :null => false
end
add_index "users", ["admin"], :name => "index_users_on_admin"