diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-23 15:07:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-23 15:07:58 +0300 |
commit | 71355c5f36964482ae303c906505dc7138e2c7d7 (patch) | |
tree | 0a0ee4858c1b0a894fc946edaeb652ef64cf590d /db | |
parent | 4a3d1b728146eca491a4be53a353613d98562254 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20210616154808_remove_ci_build_protected_index.rb | 19 | ||||
-rw-r--r-- | db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb | 20 | ||||
-rw-r--r-- | db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb | 19 | ||||
-rw-r--r-- | db/schema_migrations/20210616154808 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20210621155328 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20210621164210 | 1 | ||||
-rw-r--r-- | db/structure.sql | 4 |
7 files changed, 62 insertions, 3 deletions
diff --git a/db/migrate/20210616154808_remove_ci_build_protected_index.rb b/db/migrate/20210616154808_remove_ci_build_protected_index.rb new file mode 100644 index 00000000000..25a8d159c1e --- /dev/null +++ b/db/migrate/20210616154808_remove_ci_build_protected_index.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveCiBuildProtectedIndex < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + INDEX_NAME = 'index_ci_builds_on_protected' + + disable_ddl_transaction! + + def up + remove_concurrent_index :ci_builds, :protected, name: INDEX_NAME + end + + def down + add_concurrent_index :ci_builds, :protected, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb b/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb new file mode 100644 index 00000000000..498090c3ab9 --- /dev/null +++ b/db/post_migrate/20210621155328_replace_project_authorizations_project_id_index.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class ReplaceProjectAuthorizationsProjectIdIndex < ActiveRecord::Migration[6.1] + include Gitlab::Database::MigrationHelpers + + disable_ddl_transaction! + + OLD_INDEX_NAME = 'index_project_authorizations_on_project_id' + NEW_INDEX_NAME = 'index_project_authorizations_on_project_id_user_id' + + def up + add_concurrent_index(:project_authorizations, [:project_id, :user_id], name: NEW_INDEX_NAME) + remove_concurrent_index_by_name(:project_authorizations, OLD_INDEX_NAME) + end + + def down + add_concurrent_index(:project_authorizations, :project_id, name: OLD_INDEX_NAME) + remove_concurrent_index_by_name(:project_authorizations, NEW_INDEX_NAME) + end +end diff --git a/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb b/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb new file mode 100644 index 00000000000..0430c8447d9 --- /dev/null +++ b/db/post_migrate/20210621164210_drop_remove_on_close_from_labels.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DropRemoveOnCloseFromLabels < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + def up + # Migration that adds column was reverted, but run in Gitlab SaaS stg and prod + return unless column_exists?(:labels, :remove_on_close) + + with_lock_retries do + remove_column :labels, :remove_on_close + end + end + + def down + # No rollback as the original migration was reverted in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62056 + # up simply removes the column from envs where the original migration was run + end +end diff --git a/db/schema_migrations/20210616154808 b/db/schema_migrations/20210616154808 new file mode 100644 index 00000000000..be7d5811540 --- /dev/null +++ b/db/schema_migrations/20210616154808 @@ -0,0 +1 @@ +adfa07888317cb7f22062f5d23906bc01de579305acb3bb3384f18e3f581a87b
\ No newline at end of file diff --git a/db/schema_migrations/20210621155328 b/db/schema_migrations/20210621155328 new file mode 100644 index 00000000000..ba3dd235cee --- /dev/null +++ b/db/schema_migrations/20210621155328 @@ -0,0 +1 @@ +d08fdc3da5fe1a7bf20af5fbe42438fc43ebdf1299c61159740df7644e4ea117
\ No newline at end of file diff --git a/db/schema_migrations/20210621164210 b/db/schema_migrations/20210621164210 new file mode 100644 index 00000000000..6855b8e42ee --- /dev/null +++ b/db/schema_migrations/20210621164210 @@ -0,0 +1 @@ +b952f1e3fe2bfa680ba68b79637e0a2a1ee5b388cfa106db62521a663262b024
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 6d25d1c42df..a67964b30d2 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22817,8 +22817,6 @@ CREATE INDEX index_ci_builds_on_project_id_and_name_and_ref ON ci_builds USING b CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_builds USING btree (project_id) WHERE (((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text)); -CREATE INDEX index_ci_builds_on_protected ON ci_builds USING btree (protected); - CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at); CREATE INDEX index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC); @@ -24253,7 +24251,7 @@ CREATE UNIQUE INDEX index_project_aliases_on_name ON project_aliases USING btree CREATE INDEX index_project_aliases_on_project_id ON project_aliases USING btree (project_id); -CREATE INDEX index_project_authorizations_on_project_id ON project_authorizations USING btree (project_id); +CREATE INDEX index_project_authorizations_on_project_id_user_id ON project_authorizations USING btree (project_id, user_id); CREATE UNIQUE INDEX index_project_auto_devops_on_project_id ON project_auto_devops USING btree (project_id); |