diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-07 06:07:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-07 06:07:49 +0300 |
commit | a31408ba64f61275813cc3ffd5aa9bc9ce9f3319 (patch) | |
tree | 711e3c6f7ea239e0aedc28a815d7067280399314 /db | |
parent | 175f124d93ba52aeb850b5c032930168612d1e71 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20221020124018_add_delete_started_at_to_container_repositories.rb | 11 | ||||
-rw-r--r-- | db/migrate/20221025105205_add_status_and_id_index_to_container_repositories.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20221020124018 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20221025105205 | 1 | ||||
-rw-r--r-- | db/structure.sql | 3 |
5 files changed, 31 insertions, 0 deletions
diff --git a/db/migrate/20221020124018_add_delete_started_at_to_container_repositories.rb b/db/migrate/20221020124018_add_delete_started_at_to_container_repositories.rb new file mode 100644 index 00000000000..c225d9cc343 --- /dev/null +++ b/db/migrate/20221020124018_add_delete_started_at_to_container_repositories.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddDeleteStartedAtToContainerRepositories < Gitlab::Database::Migration[2.0] + def change + add_column :container_repositories, + :delete_started_at, + :datetime_with_timezone, + null: true, + default: nil + end +end diff --git a/db/migrate/20221025105205_add_status_and_id_index_to_container_repositories.rb b/db/migrate/20221025105205_add_status_and_id_index_to_container_repositories.rb new file mode 100644 index 00000000000..380ffd2e484 --- /dev/null +++ b/db/migrate/20221025105205_add_status_and_id_index_to_container_repositories.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddStatusAndIdIndexToContainerRepositories < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_container_repositories_on_status_and_id' + + def up + add_concurrent_index :container_repositories, [:status, :id], name: INDEX_NAME, where: 'status IS NOT NULL' + end + + def down + remove_concurrent_index :container_repositories, [:status, :id], name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20221020124018 b/db/schema_migrations/20221020124018 new file mode 100644 index 00000000000..6f6c76eb531 --- /dev/null +++ b/db/schema_migrations/20221020124018 @@ -0,0 +1 @@ +c4b296345f45b6184e04181708eb2f55a1b3a621f331b75173b33b0036c3176f
\ No newline at end of file diff --git a/db/schema_migrations/20221025105205 b/db/schema_migrations/20221025105205 new file mode 100644 index 00000000000..4003f74aa11 --- /dev/null +++ b/db/schema_migrations/20221025105205 @@ -0,0 +1 @@ +80daa2f50ae9f8c0dee206ed9d45eb04884e14a0331475cb8c9a2d57f4c86ef5
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 416bdd9bf2f..2c69d2baea8 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -14140,6 +14140,7 @@ CREATE TABLE container_repositories ( migration_aborted_in_state text, migration_plan text, last_cleanup_deleted_tags_count integer, + delete_started_at timestamp with time zone, CONSTRAINT check_05e9012f36 CHECK ((char_length(migration_plan) <= 255)), CONSTRAINT check_13c58fe73a CHECK ((char_length(migration_state) <= 255)), CONSTRAINT check_97f0249439 CHECK ((char_length(migration_aborted_in_state) <= 255)) @@ -28688,6 +28689,8 @@ CREATE INDEX index_container_repositories_on_project_id_and_id ON container_repo CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON container_repositories USING btree (project_id, name); +CREATE INDEX index_container_repositories_on_status_and_id ON container_repositories USING btree (status, id) WHERE (status IS NOT NULL); + CREATE INDEX index_container_repository_on_name_trigram ON container_repositories USING gin (name gin_trgm_ops); CREATE UNIQUE INDEX index_content_blocked_states_on_container_id_commit_sha_path ON content_blocked_states USING btree (container_identifier, commit_sha, path); |