diff --git a/app/models/external_pull_request.rb b/app/models/external_pull_request.rb
index 3fc166203e702bc758a193c53b037a8dee4221d3..4654f7e2341e50ffa264cb14e6f2fb2656b90ad0 100644
--- a/app/models/external_pull_request.rb
+++ b/app/models/external_pull_request.rb
@@ -11,7 +11,7 @@
 # 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 so, we create pipelines for external pull requests.
-class ExternalPullRequest < ApplicationRecord
+class ExternalPullRequest < Ci::ApplicationRecord
   include Gitlab::Utils::StrongMemoize
   include ShaAttribute
 
@@ -40,6 +40,9 @@ class ExternalPullRequest < ApplicationRecord
   scope :by_source_branch, ->(branch) { where(source_branch: branch) }
   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)
     find_params = params.slice(:project_id, :source_branch, :target_branch)
 
diff --git a/lib/gitlab/database/gitlab_schemas.yml b/lib/gitlab/database/gitlab_schemas.yml
index c9096de6b6e5090887087b8e53a67ef7929994b7..025a59a14fd7b3e19de8193b012a4d8353b6af9c 100644
--- a/lib/gitlab/database/gitlab_schemas.yml
+++ b/lib/gitlab/database/gitlab_schemas.yml
@@ -200,7 +200,7 @@ experiment_subjects: :gitlab_main
 experiment_users: :gitlab_main
 external_approval_rules: :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_protected_branches: :gitlab_main
 feature_gates: :gitlab_main