diff options
Diffstat (limited to 'lib/gitlab/database/partitioning/time_partition.rb')
-rw-r--r-- | lib/gitlab/database/partitioning/time_partition.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/database/partitioning/time_partition.rb b/lib/gitlab/database/partitioning/time_partition.rb index 1221f042530..e09ca483549 100644 --- a/lib/gitlab/database/partitioning/time_partition.rb +++ b/lib/gitlab/database/partitioning/time_partition.rb @@ -69,6 +69,10 @@ module Gitlab partition_name <=> other.partition_name end + def holds_data? + conn.execute("SELECT 1 FROM #{fully_qualified_partition} LIMIT 1").ntuples > 0 + end + private def date_or_nil(obj) |