summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMałgorzata Ksionek <meksionek@gmail.com>2019-03-21 15:07:44 +0100
committerMałgorzata Ksionek <meksionek@gmail.com>2019-03-21 15:07:44 +0100
commitc78bbf40838574492e6b24667907d693df0721f2 (patch)
treee174087483c269df673e5107613e3fa63d1295c8
parent7d8091b79c1bfca5ae3964ff199c51b25725743a (diff)
downloadgitlab-ce-57620-add-time-preferences-for-user-be.tar.gz
Add migrattion for new fields57620-add-time-preferences-for-user-be
-rw-r--r--db/migrate/20190321124130_add_time_settings_to_user.rb24
-rw-r--r--db/schema.rb5
2 files changed, 28 insertions, 1 deletions
diff --git a/db/migrate/20190321124130_add_time_settings_to_user.rb b/db/migrate/20190321124130_add_time_settings_to_user.rb
new file mode 100644
index 00000000000..f7c694d7d18
--- /dev/null
+++ b/db/migrate/20190321124130_add_time_settings_to_user.rb
@@ -0,0 +1,24 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddTimeSettingsToUser < ActiveRecord::Migration[5.0]
+ include Gitlab::Database::MigrationHelpers
+
+ disable_ddl_transaction!
+
+ DOWNTIME = false
+
+ def up
+ add_column_with_default(:users, :timezone, :string, default: 'UTC')
+ add_column_with_default(:users, :time_display, :boolean, default: false)
+ add_column_with_default(:users, :time_format, :boolean, default: false)
+ end
+
+ def down
+ remove_column(:users, :timezone)
+ remove_column(:users, :time_display)
+ remove_column(:users, :time_format)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index dda0445e3f2..a046273499d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20190301182457) do
+ActiveRecord::Schema.define(version: 20190321124130) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -2280,6 +2280,9 @@ ActiveRecord::Schema.define(version: 20190301182457) do
t.boolean "private_profile"
t.boolean "include_private_contributions"
t.string "commit_email"
+ t.string "timezone", default: "UTC", null: false
+ t.boolean "time_display", default: false, null: false
+ t.boolean "time_format", default: false, null: false
t.index ["accepted_term_id"], name: "index_users_on_accepted_term_id", using: :btree
t.index ["admin"], name: "index_users_on_admin", using: :btree
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree