blob: 69a69091b5c37460daec7d59b0f74cf53cad7fbe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# frozen_string_literal: true
module Gitlab
module Database
module Partitioning
class CiSlidingListStrategy < SlidingListStrategy
def initial_partition
partition_for(100)
end
def next_partition
partition_for(active_partition.value + 1)
end
def validate_and_fix; end
def after_adding_partitions; end
def extra_partitions
[]
end
private
def ensure_partitioning_column_ignored_or_readonly!; end
def partition_for(value)
SingleNumericListPartition.new(table_name, value, partition_name: partition_name(value))
end
def partition_name(value)
[
table_name.to_s.delete_prefix('p_'),
value
].join('_')
end
end
end
end
end
|