diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 15:09:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-11 15:09:26 +0300 |
commit | c9687bdf58e9d4a9c3942f587bd4841f42e3b5de (patch) | |
tree | a60a2e20f152483be6a92bacdf10564bbc96c664 /db | |
parent | 3f3e4bcc50a3280d03299c2c263eafd9c8e3bd7b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
4 files changed, 56 insertions, 1 deletions
diff --git a/db/migrate/20200309140540_add_index_on_project_id_and_repository_access_level_to_project_features.rb b/db/migrate/20200309140540_add_index_on_project_id_and_repository_access_level_to_project_features.rb new file mode 100644 index 00000000000..a2093db0b3b --- /dev/null +++ b/db/migrate/20200309140540_add_index_on_project_id_and_repository_access_level_to_project_features.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnProjectIdAndRepositoryAccessLevelToProjectFeatures < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + INDEX_NAME = 'index_project_features_on_project_id_ral_20' + + disable_ddl_transaction! + + def up + add_concurrent_index :project_features, :project_id, where: 'repository_access_level = 20', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :project_features, INDEX_NAME + end +end diff --git a/db/migrate/20200310132654_add_instance_to_services.rb b/db/migrate/20200310132654_add_instance_to_services.rb new file mode 100644 index 00000000000..85b16a4094c --- /dev/null +++ b/db/migrate/20200310132654_add_instance_to_services.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddInstanceToServices < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_column_with_default(:services, :instance, :boolean, default: false) + end + + def down + remove_column(:services, :instance) + end +end diff --git a/db/migrate/20200310135823_add_index_to_service_unique_instance_per_type.rb b/db/migrate/20200310135823_add_index_to_service_unique_instance_per_type.rb new file mode 100644 index 00000000000..1a60c521b71 --- /dev/null +++ b/db/migrate/20200310135823_add_index_to_service_unique_instance_per_type.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToServiceUniqueInstancePerType < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index(:services, [:type, :instance], unique: true, where: 'instance IS TRUE') + end + + def down + remove_concurrent_index(:services, [:type, :instance]) + end +end diff --git a/db/schema.rb b/db/schema.rb index 62cce205424..2b726073035 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_09_195710) do +ActiveRecord::Schema.define(version: 2020_03_10_135823) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -3265,6 +3265,7 @@ ActiveRecord::Schema.define(version: 2020_03_09_195710) do t.integer "forking_access_level" t.index ["project_id"], name: "index_project_features_on_project_id", unique: true t.index ["project_id"], name: "index_project_features_on_project_id_bal_20", where: "(builds_access_level = 20)" + t.index ["project_id"], name: "index_project_features_on_project_id_ral_20", where: "(repository_access_level = 20)" end create_table "project_group_links", id: :serial, force: :cascade do |t| @@ -3939,8 +3940,10 @@ ActiveRecord::Schema.define(version: 2020_03_09_195710) do t.string "description", limit: 500 t.boolean "comment_on_event_enabled", default: true, null: false t.boolean "template", default: false + t.boolean "instance", default: false, null: false t.index ["project_id"], name: "index_services_on_project_id" t.index ["template"], name: "index_services_on_template" + t.index ["type", "instance"], name: "index_services_on_type_and_instance", unique: true, where: "(instance IS TRUE)" t.index ["type", "template"], name: "index_services_on_type_and_template", unique: true, where: "(template IS TRUE)" t.index ["type"], name: "index_services_on_type" end |