Commit 3ca4dce
Changed files (2)
db/migrate/20160523142832_change_default_time_zone.rb
@@ -0,0 +1,11 @@
+class ChangeDefaultTimeZone < ActiveRecord::Migration
+ def up
+ change_column :profiles, :time_zone, :string, default: "Etc/UTC", null: false
+ Profile.where(time_zone: "UTC").update_all(time_zone: "Etc/UTC")
+ end
+
+ def down
+ change_column :profiles, :time_zone, :string, default: "UTC", null: false
+ Profile.where(time_zone: "Etc/UTC").update_all(time_zone: "UTC")
+ end
+end
db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20160521154610) do
+ActiveRecord::Schema.define(version: 20160523142832) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -67,12 +67,12 @@ ActiveRecord::Schema.define(version: 20160521154610) do
add_index "locations", ["locatable_id", "locatable_type"], name: "index_locations_on_locatable_id_and_locatable_type", using: :btree
create_table "profiles", id: :uuid, default: "uuid_generate_v4()", force: :cascade do |t|
- t.uuid "user_id", null: false
+ t.uuid "user_id", null: false
t.integer "gender"
t.integer "social_tolerance"
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.string "time_zone", default: "UTC", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.string "time_zone", default: "Etc/UTC", null: false
end
add_index "profiles", ["user_id"], name: "index_profiles_on_user_id", using: :btree