pg_partitioner 0.7.2 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c728338fd4206174f0dc4f4632c7dd54be951f419295f56c96d0b161327ced9
|
|
4
|
+
data.tar.gz: bca15bd396a5606b632e8c3f00af80163bd6d6a8f65d3626e1e7ea7761338575
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d1d47e0c1e8bf3d70b2c4f1de6702cedb1a337025bbbd22d14e8c6a783a3167c19a8fc14462cd25793feee5fb91a7e0c4117959c54188ee4b24ec33871793e9
|
|
7
|
+
data.tar.gz: fe83006a1699ef8cb31ce9dc2e1fe739bb1c220cf1a93223a339648b6662d144993ce7b7ce4a317409f66a6f4765cbae21958b2335af138076695771bb5aa01f
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module PgPartitioner
|
|
2
2
|
module SeparationType
|
|
3
3
|
module Month
|
|
4
|
-
def create_current_month_table
|
|
5
|
-
create_month_table(Date.today)
|
|
4
|
+
def create_current_month_table(autovacuum:)
|
|
5
|
+
create_month_table(Date.today, autovacuum:)
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
def create_next_month_table
|
|
9
|
-
create_month_table(Date.today.next_month)
|
|
8
|
+
def create_next_month_table(autovacuum:)
|
|
9
|
+
create_month_table(Date.today.next_month, autovacuum)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def drop_old_month_table
|
|
@@ -15,7 +15,7 @@ module PgPartitioner
|
|
|
15
15
|
drop_table(table_name)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def create_month_table(date = Date.today)
|
|
18
|
+
def create_month_table(date = Date.today, autovacuum = true)
|
|
19
19
|
date_start = date.at_beginning_of_month
|
|
20
20
|
date_end = date.at_beginning_of_month.next_month
|
|
21
21
|
partition_table_name = name_of_partition_table(date, type: :month)
|
|
@@ -28,7 +28,7 @@ module PgPartitioner
|
|
|
28
28
|
sql = "ALTER TABLE #{partition_table_name} ADD PRIMARY KEY (id);"
|
|
29
29
|
execute_sql(sql)
|
|
30
30
|
|
|
31
|
-
disable_autovacuum(partition_table_name)
|
|
31
|
+
disable_autovacuum(partition_table_name) if autovacuum == false
|
|
32
32
|
create_partition_indexes(partition_table_name)
|
|
33
33
|
create_partition_named_indexes(partition_table_name)
|
|
34
34
|
create_partition_unique_indexes(partition_table_name)
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
module PgPartitioner
|
|
2
2
|
module SeparationType
|
|
3
3
|
module Quater
|
|
4
|
-
def create_current_quater_table
|
|
5
|
-
create_quater_table(Date.today)
|
|
4
|
+
def create_current_quater_table(autovacuum:)
|
|
5
|
+
create_quater_table(Date.today, autovacuum)
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
def create_next_quater_table
|
|
9
|
-
create_quater_table(Date.today.next_quarter)
|
|
8
|
+
def create_next_quater_table(autovacuum:)
|
|
9
|
+
create_quater_table(Date.today.next_quarter, autovacuum)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def create_quater_table(date = Date.today)
|
|
12
|
+
def create_quater_table(date = Date.today, autovacuum = true)
|
|
13
13
|
date_start = date.at_beginning_of_quarter
|
|
14
14
|
date_end = date.end_of_quarter.next_month.at_beginning_of_month
|
|
15
15
|
partition_table_name = name_of_partition_table(date, type: :quater)
|
|
@@ -22,7 +22,7 @@ module PgPartitioner
|
|
|
22
22
|
sql = "ALTER TABLE #{partition_table_name} ADD PRIMARY KEY (id);"
|
|
23
23
|
execute_sql(sql)
|
|
24
24
|
|
|
25
|
-
disable_autovacuum(partition_table_name)
|
|
25
|
+
disable_autovacuum(partition_table_name) if autovacuum == false
|
|
26
26
|
create_partition_indexes(partition_table_name)
|
|
27
27
|
create_partition_named_indexes(partition_table_name)
|
|
28
28
|
create_partition_unique_indexes(partition_table_name)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
module PgPartitioner
|
|
2
2
|
module SeparationType
|
|
3
3
|
module Week
|
|
4
|
-
def create_current_week_table
|
|
5
|
-
create_week_table(Date.today)
|
|
4
|
+
def create_current_week_table(autovacuum: )
|
|
5
|
+
create_week_table(Date.today, autovacuum)
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
def create_next_week_table
|
|
9
|
-
create_week_table(Date.today.next_week)
|
|
8
|
+
def create_next_week_table(autovacuum: )
|
|
9
|
+
create_week_table(Date.today.next_week, autovacuum)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def drop_old_week_table
|
|
@@ -15,7 +15,7 @@ module PgPartitioner
|
|
|
15
15
|
drop_table(table_name)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def create_week_table(date = Date.today)
|
|
18
|
+
def create_week_table(date = Date.today, autovacuum = true)
|
|
19
19
|
date_start = date.at_beginning_of_week
|
|
20
20
|
date_end = date.at_beginning_of_week.next_week
|
|
21
21
|
partition_table_name = name_of_partition_table(date, type: :week)
|
|
@@ -28,7 +28,7 @@ module PgPartitioner
|
|
|
28
28
|
sql = "ALTER TABLE #{partition_table_name} ADD PRIMARY KEY (id);"
|
|
29
29
|
execute_sql(sql)
|
|
30
30
|
|
|
31
|
-
disable_autovacuum(partition_table_name)
|
|
31
|
+
disable_autovacuum(partition_table_name) if autovacuum == false
|
|
32
32
|
create_partition_indexes(partition_table_name)
|
|
33
33
|
create_partition_named_indexes(partition_table_name)
|
|
34
34
|
create_partition_unique_indexes(partition_table_name)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pg_partitioner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ovsapyan Mishel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|