diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-10 18:16:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-10 18:16:36 +0300 |
commit | f93ec4cb3933e2fe25b90844a6671f2bf312c5a3 (patch) | |
tree | ec17d40be44fba1a8fa53a31baa4e5e33223e698 /db | |
parent | 03d905f63fe0c0cab4711bf1ff41887b595e6e49 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
5 files changed, 32 insertions, 3 deletions
diff --git a/db/migrate/20230329032129_add_lock_version_to_terraform_state.rb b/db/migrate/20230329032129_add_lock_version_to_terraform_state.rb new file mode 100644 index 00000000000..78f0122c609 --- /dev/null +++ b/db/migrate/20230329032129_add_lock_version_to_terraform_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddLockVersionToTerraformState < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :terraform_states, :activerecord_lock_version, :integer, null: false, default: 0 + end +end diff --git a/db/post_migrate/20230404061832_drop_sync_index_ci_job_artifacts_on_expire_at_for_removal.rb b/db/post_migrate/20230404061832_drop_sync_index_ci_job_artifacts_on_expire_at_for_removal.rb new file mode 100644 index 00000000000..efa0792c457 --- /dev/null +++ b/db/post_migrate/20230404061832_drop_sync_index_ci_job_artifacts_on_expire_at_for_removal.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropSyncIndexCiJobArtifactsOnExpireAtForRemoval < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_ci_job_artifacts_on_expire_at_for_removal' + CONDITIONS = 'locked = 0 AND expire_at IS NOT NULL' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :ci_job_artifacts, name: INDEX_NAME + end + + def down + add_concurrent_index :ci_job_artifacts, [:expire_at], where: CONDITIONS, name: INDEX_NAME + end +end diff --git a/db/schema_migrations/20230329032129 b/db/schema_migrations/20230329032129 new file mode 100644 index 00000000000..3aec19e9d99 --- /dev/null +++ b/db/schema_migrations/20230329032129 @@ -0,0 +1 @@ +89a256c209e4c402d3162c7c967b7515870e80801e637a372fb9ee670d8e535e
\ No newline at end of file diff --git a/db/schema_migrations/20230404061832 b/db/schema_migrations/20230404061832 new file mode 100644 index 00000000000..14cdca25567 --- /dev/null +++ b/db/schema_migrations/20230404061832 @@ -0,0 +1 @@ +51e141580bfb02dbe9ab215bd9283c01598353cb3f59fbe52ab0ab26a7974b49
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index cb57029f218..a09543d9a57 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22884,7 +22884,8 @@ CREATE TABLE terraform_states ( uuid character varying(32) NOT NULL, name character varying(255) NOT NULL, versioning_enabled boolean DEFAULT true NOT NULL, - deleted_at timestamp with time zone + deleted_at timestamp with time zone, + activerecord_lock_version integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE terraform_states_id_seq @@ -29761,8 +29762,6 @@ CREATE INDEX index_ci_job_artifacts_id_for_terraform_reports ON ci_job_artifacts CREATE INDEX index_ci_job_artifacts_on_expire_at_and_job_id ON ci_job_artifacts USING btree (expire_at, job_id); -CREATE INDEX index_ci_job_artifacts_on_expire_at_for_removal ON ci_job_artifacts USING btree (expire_at) WHERE ((locked = 0) AND (expire_at IS NOT NULL)); - CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btree (file_store); CREATE INDEX index_ci_job_artifacts_on_file_type_for_devops_adoption ON ci_job_artifacts USING btree (file_type, project_id, created_at) WHERE (file_type = ANY (ARRAY[5, 6, 8, 23])); |