Commit 4246141f authored by Fabio Pitino's avatar Fabio Pitino

Merge branch '348271-move-external-pull-requests-to-ci-db' into 'master'

Move external_pull_requests to CI DB

See merge request gitlab-org/gitlab!76824
parents 0ecee668 d3b7dd23
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# When the mirror is updated and changes are pushed to branches we check # When the mirror is updated and changes are pushed to branches we check
# if there are open pull requests for the source and target branch. # if there are open pull requests for the source and target branch.
# If so, we create pipelines for external pull requests. # If so, we create pipelines for external pull requests.
class ExternalPullRequest < ApplicationRecord class ExternalPullRequest < Ci::ApplicationRecord
include Gitlab::Utils::StrongMemoize include Gitlab::Utils::StrongMemoize
include ShaAttribute include ShaAttribute
...@@ -40,6 +40,9 @@ class ExternalPullRequest < ApplicationRecord ...@@ -40,6 +40,9 @@ class ExternalPullRequest < ApplicationRecord
scope :by_source_branch, ->(branch) { where(source_branch: branch) } scope :by_source_branch, ->(branch) { where(source_branch: branch) }
scope :by_source_repository, -> (repository) { where(source_repository: repository) } scope :by_source_repository, -> (repository) { where(source_repository: repository) }
# Needed to override Ci::ApplicationRecord as this does not have ci_ table prefix
self.table_name = 'external_pull_requests'
def self.create_or_update_from_params(params) def self.create_or_update_from_params(params)
find_params = params.slice(:project_id, :source_branch, :target_branch) find_params = params.slice(:project_id, :source_branch, :target_branch)
......
...@@ -200,7 +200,7 @@ experiment_subjects: :gitlab_main ...@@ -200,7 +200,7 @@ experiment_subjects: :gitlab_main
experiment_users: :gitlab_main experiment_users: :gitlab_main
external_approval_rules: :gitlab_main external_approval_rules: :gitlab_main
external_approval_rules_protected_branches: :gitlab_main external_approval_rules_protected_branches: :gitlab_main
external_pull_requests: :gitlab_main external_pull_requests: :gitlab_ci
external_status_checks: :gitlab_main external_status_checks: :gitlab_main
external_status_checks_protected_branches: :gitlab_main external_status_checks_protected_branches: :gitlab_main
feature_gates: :gitlab_main feature_gates: :gitlab_main
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment