diff options
Diffstat (limited to 'lib/gitlab/database/postgres_partition.rb')
-rw-r--r-- | lib/gitlab/database/postgres_partition.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/database/postgres_partition.rb b/lib/gitlab/database/postgres_partition.rb index e4f70ee1745..36dc6818157 100644 --- a/lib/gitlab/database/postgres_partition.rb +++ b/lib/gitlab/database/postgres_partition.rb @@ -8,7 +8,9 @@ module Gitlab belongs_to :postgres_partitioned_table, foreign_key: 'parent_identifier', primary_key: 'identifier' scope :for_identifier, ->(identifier) do - raise ArgumentError, "Partition name is not fully qualified with a schema: #{identifier}" unless identifier =~ /^\w+\.\w+$/ + unless identifier =~ Gitlab::Database::FULLY_QUALIFIED_IDENTIFIER + raise ArgumentError, "Partition name is not fully qualified with a schema: #{identifier}" + end where(primary_key => identifier) end |