From c78bbf40838574492e6b24667907d693df0721f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C5=82gorzata=20Ksionek?= Date: Thu, 21 Mar 2019 15:07:44 +0100 Subject: Add migrattion for new fields --- .../20190321124130_add_time_settings_to_user.rb | 24 ++++++++++++++++++++++ db/schema.rb | 5 ++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190321124130_add_time_settings_to_user.rb 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 -- cgit v1.2.1