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

Add v2 approval rule table and model

Adds new approval rule table and model
for new approval rule architecture.

Changelog: changed
MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179839
EE: true
上级 bac06384
No related branches found
No related tags found
无相关合并请求
显示
229 个添加0 个删除
---
table_name: merge_requests_approval_rules_groups
classes:
- MergeRequests::ApprovalRulesGroup
feature_categories:
- code_review_workflow
description: Stores relationship between approval rules v2 and groups
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179861
milestone: '17.9'
gitlab_schema: gitlab_main_cell
sharding_key:
group_id: namespaces
---
table_name: merge_requests_approval_rules_merge_requests
classes:
- MergeRequests::ApprovalRulesMergeRequest
feature_categories:
- code_review_workflow
description: Stores relationship between approval rules v2 and merge requests
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179861
milestone: '17.9'
gitlab_schema: gitlab_main_cell
sharding_key:
project_id: projects
---
table_name: merge_requests_approval_rules_projects
classes:
- MergeRequests::ApprovalRulesProject
feature_categories:
- code_review_workflow
description: Stores relationship between approval rules v2 and projects
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/179861
milestone: '17.9'
gitlab_schema: gitlab_main_cell
sharding_key:
project_id: projects
# frozen_string_literal: true
class CreateMergeRequestsApprovalRulesGroups < Gitlab::Database::Migration[2.2]
milestone '17.9'
def change
create_table :merge_requests_approval_rules_groups do |t| # -- Migration/EnsureFactoryForTable false positive
t.bigint :approval_rule_id, null: false
t.bigint :group_id, null: false
t.index :group_id
t.timestamps_with_timezone null: false
end
add_index(
:merge_requests_approval_rules_groups,
%i[approval_rule_id group_id],
unique: true,
name: 'index_mrs_ars_groups_on_ar_id_and_group_id'
)
end
end
# frozen_string_literal: true
class CreateMergeRequestsApprovalRulesMergeRequests < Gitlab::Database::Migration[2.2]
milestone '17.9'
def change
create_table :merge_requests_approval_rules_merge_requests do |t| # Migration/EnsureFactoryForTable false positive
t.bigint :approval_rule_id, null: false
t.bigint :merge_request_id, null: false
t.bigint :project_id, null: false
t.index :merge_request_id, name: 'index_mrs_approval_rules_mrs_on_mr_id'
t.index :project_id, name: 'index_mrs_approval_rules_mrs_on_project_id'
t.timestamps_with_timezone null: false
end
add_index(
:merge_requests_approval_rules_merge_requests,
%i[approval_rule_id merge_request_id],
unique: true,
name: 'index_mrs_ars_mrs_on_ar_id_and_mr_id'
)
end
end
# frozen_string_literal: true
class CreateMergeRequestsApprovalRulesProjects < Gitlab::Database::Migration[2.2]
milestone '17.9'
def change
create_table :merge_requests_approval_rules_projects do |t| # -- Migration/EnsureFactoryForTable false positive
t.bigint :approval_rule_id, null: false
t.bigint :project_id, null: false
t.index :project_id, name: 'index_mrs_approval_rules_projects_on_project_id'
t.timestamps_with_timezone null: false
end
add_index(
:merge_requests_approval_rules_projects,
%i[approval_rule_id project_id],
unique: true,
name: 'index_mrs_ars_projects_on_ar_id_and_project_id'
)
end
end
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesGroupsApprovalRuleFk < Gitlab::Database::Migration[2.2]
milestone '17.9'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_groups, :merge_requests_approval_rules,
column: :approval_rule_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_groups, column: :approval_rule_id
end
end
end
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesGroupsGroupFk < Gitlab::Database::Migration[2.2]
milestone '17.9'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_groups, :namespaces, column: :group_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_groups, column: :group_id
end
end
end
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesProjectsApprovalRuleFk < Gitlab::Database::Migration[2.2]
milestone '17.9'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_projects, :merge_requests_approval_rules,
column: :approval_rule_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_projects, column: :approval_rule_id
end
end
end
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesProjectsProjectFk < Gitlab::Database::Migration[2.2]
milestone '17.9'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_projects, :projects, column: :project_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_projects, column: :project_id
end
end
end
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesMrsApprovalRuleFk < Gitlab::Database::Migration[2.2]
milestone '17.9'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_merge_requests, :merge_requests_approval_rules,
column: :approval_rule_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_merge_requests, column: :approval_rule_id
end
end
end
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesMrsMrFk < Gitlab::Database::Migration[2.2]
milestone '17.9'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_merge_requests, :merge_requests,
column: :merge_request_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_merge_requests, column: :merge_request_id
end
end
end
# frozen_string_literal: true
class AddMergeRequestsApprovalRulesMrsProjectFk < Gitlab::Database::Migration[2.2]
milestone '17.9'
disable_ddl_transaction!
def up
add_concurrent_foreign_key :merge_requests_approval_rules_merge_requests, :projects,
column: :project_id,
on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :merge_requests_approval_rules_merge_requests, column: :project_id
end
end
end
620def37e032e7fa463c4f1ecff0aacde33a5b9bd7a56c2f6ead418b3f4ce828
\ No newline at end of file
e5a26f1a31603cf3ac570824874afbeac3bb970ca079bdaaebbf9cbe13155230
\ No newline at end of file
d6fc925f97583a4509894202b2e529ae64138f2cceef76e0d0c4dcaafe70f45a
\ No newline at end of file
56101662487483f6866c2c1f2cd0ee66d1fa12d08c0da12bd550d389e37f6bf7
\ No newline at end of file
4b740e775e43ed2143b7060b5e5e1730aeb7309cc83e4d76a5316cc84e80893b
\ No newline at end of file
31f9cc1659cd680b16a742eddeb361c4eb059388b1af0136d0d5a648a6fb8cca
\ No newline at end of file
08d74afd22511618546821c8cc53473ec3a9f6ec4be3c80a20086e1a2e71da37
\ No newline at end of file
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册