diff options
Diffstat (limited to 'lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key.rb')
-rw-r--r-- | lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key.rb b/lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key.rb new file mode 100644 index 00000000000..f9a90511f9b --- /dev/null +++ b/lib/gitlab/database/partitioning_migration_helpers/partitioned_foreign_key.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Gitlab + module Database + module PartitioningMigrationHelpers + class PartitionedForeignKey < ApplicationRecord + validates_with PartitionedForeignKeyValidator + + scope :by_referenced_table, ->(table) { where(to_table: table) } + end + end + end +end |