summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2016-05-23 08:45:38 -0600
committermo khan <mo@mokhan.ca>2016-05-23 08:45:38 -0600
commit3ca4dcecead9e8253bb2db2df4475a2551fef83e (patch)
tree421bcf9b7ee263dd83b275fbdd39373ac41191f6
parentd9d570e0d470b43ce7cdae6f3dfd3729576ec0d3 (diff)
update default timezone.
-rw-r--r--db/migrate/20160523142832_change_default_time_zone.rb11
-rw-r--r--db/schema.rb10
2 files changed, 16 insertions, 5 deletions
diff --git a/db/migrate/20160523142832_change_default_time_zone.rb b/db/migrate/20160523142832_change_default_time_zone.rb
new file mode 100644
index 0000000..c86de15
--- /dev/null
+++ b/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
diff --git a/db/schema.rb b/db/schema.rb
index 30c67a0..32438be 100644
--- a/db/schema.rb
+++ b/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