Skip to content
代码片段 群组 项目
未验证 提交 f6ccde10 编辑于 作者: Tiger Watson's avatar Tiger Watson 提交者: GitLab
浏览文件

Merge branch '467120/index-for-LFS-non-null-repo-type' into 'master'

Ensure unique index for LFS objects with repository_type

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/184269



Merged-by: default avatarTiger Watson <twatson@gitlab.com>
Approved-by: default avatarIrina Bronipolsky <ibronipolsky@gitlab.com>
Approved-by: default avatarTiger Watson <twatson@gitlab.com>
Approved-by: default avatarJaviera Tapia <jtapia@gitlab.com>
Approved-by: default avatarJoe Woodward <jwoodward@gitlab.com>
Co-authored-by: default avatarEmma Park <epark@gitlab.com>
No related branches found
No related tags found
无相关合并请求
# frozen_string_literal: true
class AddUniqueIndexForLfsObjectsProjectsWithRepoType < Gitlab::Database::Migration[2.2]
milestone '17.10'
disable_ddl_transaction!
TABLE_NAME = :lfs_objects_projects
INDEX_NAME = 'lfs_objects_projects_on_project_id_lfs_object_id_with_repo_type'
def up
add_concurrent_index TABLE_NAME, [:project_id, :lfs_object_id, :repository_type],
unique: true,
where: "repository_type IS NOT NULL",
name: INDEX_NAME
end
def down
remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME
end
end
abe6b174ca74a5fac711e06d645fb2fc9b549c5075ac03f587fe636183ccd571
\ No newline at end of file
......@@ -36598,6 +36598,8 @@ CREATE UNIQUE INDEX kubernetes_namespaces_cluster_and_namespace ON clusters_kube
 
CREATE UNIQUE INDEX lfs_objects_projects_on_project_id_lfs_object_id_null_repo_type ON lfs_objects_projects USING btree (project_id, lfs_object_id) WHERE (repository_type IS NULL);
 
CREATE UNIQUE INDEX lfs_objects_projects_on_project_id_lfs_object_id_with_repo_type ON lfs_objects_projects USING btree (project_id, lfs_object_id, repository_type) WHERE (repository_type IS NOT NULL);
CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_and_note_id_index ON merge_request_user_mentions USING btree (merge_request_id, note_id);
 
CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_index ON merge_request_user_mentions USING btree (merge_request_id) WHERE (note_id IS NULL);
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册