diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-22 18:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-22 18:09:27 +0300 |
commit | 7a7345366550f509c03595e0dada7cbd0d73103d (patch) | |
tree | ae2c4e74faa9f87237082abf4b23f325e34df6e3 /db | |
parent | ae96e65ee23d81be3924b87ed16becbbbe002b91 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
3 files changed, 43 insertions, 1 deletions
diff --git a/db/migrate/20200406141452_add_index_to_issue_id_and_created_at_on_resource_weight_events.rb b/db/migrate/20200406141452_add_index_to_issue_id_and_created_at_on_resource_weight_events.rb new file mode 100644 index 00000000000..94a1b589ff9 --- /dev/null +++ b/db/migrate/20200406141452_add_index_to_issue_id_and_created_at_on_resource_weight_events.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddIndexToIssueIdAndCreatedAtOnResourceWeightEvents < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + INDEX_NAME = 'index_resource_weight_events_on_issue_id_and_created_at' + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :resource_weight_events, [:issue_id, :created_at], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :resource_weight_events, INDEX_NAME + end +end diff --git a/db/migrate/20200415153154_add_unique_index_on_plan_name.rb b/db/migrate/20200415153154_add_unique_index_on_plan_name.rb new file mode 100644 index 00000000000..d959d1315b4 --- /dev/null +++ b/db/migrate/20200415153154_add_unique_index_on_plan_name.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnPlanName < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + remove_concurrent_index :plans, :name + add_concurrent_index :plans, :name, unique: true + end + + def down + remove_concurrent_index :plans, :name, unique: true + add_concurrent_index :plans, :name + end +end diff --git a/db/structure.sql b/db/structure.sql index 9dc89aeeb1f..cc9a332be97 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -9872,7 +9872,7 @@ CREATE INDEX index_personal_access_tokens_on_user_id ON public.personal_access_t CREATE UNIQUE INDEX index_plan_limits_on_plan_id ON public.plan_limits USING btree (plan_id); -CREATE INDEX index_plans_on_name ON public.plans USING btree (name); +CREATE UNIQUE INDEX index_plans_on_name ON public.plans USING btree (name); CREATE UNIQUE INDEX index_pool_repositories_on_disk_path ON public.pool_repositories USING btree (disk_path); @@ -10160,6 +10160,8 @@ CREATE INDEX index_resource_milestone_events_on_milestone_id ON public.resource_ CREATE INDEX index_resource_milestone_events_on_user_id ON public.resource_milestone_events USING btree (user_id); +CREATE INDEX index_resource_weight_events_on_issue_id_and_created_at ON public.resource_weight_events USING btree (issue_id, created_at); + CREATE INDEX index_resource_weight_events_on_issue_id_and_weight ON public.resource_weight_events USING btree (issue_id, weight); CREATE INDEX index_resource_weight_events_on_user_id ON public.resource_weight_events USING btree (user_id); @@ -13232,6 +13234,7 @@ COPY "schema_migrations" (version) FROM STDIN; 20200406102111 20200406102120 20200406135648 +20200406141452 20200406192059 20200406193427 20200407094005 @@ -13262,6 +13265,7 @@ COPY "schema_migrations" (version) FROM STDIN; 20200413072059 20200413230056 20200414144547 +20200415153154 20200415160722 20200415161021 20200415161206 |