diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 06:07:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 06:07:52 +0300 |
commit | a0c1ba61c8e8c9195e3ad4deefc5c4cb5c6a1501 (patch) | |
tree | 0731210fac047fdfb04a8e907701e0efab8c897e /db | |
parent | 77237c5a6b9044f58beabc54d3589e5fa09cbfba (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200304085423_add_user_type.rb | 21 | ||||
-rw-r--r-- | db/migrate/20200304090155_add_user_type_index.rb | 17 | ||||
-rw-r--r-- | db/schema.rb | 4 |
3 files changed, 41 insertions, 1 deletions
diff --git a/db/migrate/20200304085423_add_user_type.rb b/db/migrate/20200304085423_add_user_type.rb new file mode 100644 index 00000000000..68db44c6847 --- /dev/null +++ b/db/migrate/20200304085423_add_user_type.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddUserType < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :users, :user_type, :integer, limit: 2 + end + end + + def down + with_lock_retries do + remove_column :users, :user_type + end + end +end diff --git a/db/migrate/20200304090155_add_user_type_index.rb b/db/migrate/20200304090155_add_user_type_index.rb new file mode 100644 index 00000000000..cd3b87d0a45 --- /dev/null +++ b/db/migrate/20200304090155_add_user_type_index.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddUserTypeIndex < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :users, :user_type + end + + def down + remove_concurrent_index :users, :user_type + end +end diff --git a/db/schema.rb b/db/schema.rb index e6f668884d6..a42d31160d2 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: 2020_03_03_074328) do +ActiveRecord::Schema.define(version: 2020_03_04_090155) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -4325,6 +4325,7 @@ ActiveRecord::Schema.define(version: 2020_03_03_074328) do t.string "last_name", limit: 255 t.string "static_object_token", limit: 255 t.integer "role", limit: 2 + t.integer "user_type", limit: 2 t.index "lower((name)::text)", name: "index_on_users_name_lower" t.index ["accepted_term_id"], name: "index_users_on_accepted_term_id" t.index ["admin"], name: "index_users_on_admin" @@ -4347,6 +4348,7 @@ ActiveRecord::Schema.define(version: 2020_03_03_074328) do t.index ["state"], name: "index_users_on_state_and_internal_ee", where: "((ghost IS NOT TRUE) AND (bot_type IS NULL))" t.index ["static_object_token"], name: "index_users_on_static_object_token", unique: true t.index ["unconfirmed_email"], name: "index_users_on_unconfirmed_email", where: "(unconfirmed_email IS NOT NULL)" + t.index ["user_type"], name: "index_users_on_user_type" t.index ["username"], name: "index_users_on_username" t.index ["username"], name: "index_users_on_username_trigram", opclass: :gin_trgm_ops, using: :gin end |