Skip to content

Commit da13e7e

Browse files
committed
Removed unneeded code
1 parent 6be2962 commit da13e7e

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/pgslice/cli/prep.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ def prep(table, column = nil, period = nil)
3333
declarative = version > 1
3434

3535
if declarative && options[:partition]
36-
including = ["DEFAULTS", "CONSTRAINTS", "STORAGE", "COMMENTS", "STATISTICS"]
37-
if server_version_num >= 120000
38-
including << "GENERATED"
39-
end
36+
including = ["DEFAULTS", "CONSTRAINTS", "STORAGE", "COMMENTS", "STATISTICS", "GENERATED"]
4037
if server_version_num >= 140000
4138
including << "COMPRESSION"
4239
end

test/pgslice_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_unprep_missing_table
102102
def assert_period(period, column: "createdAt", trigger_based: false, tablespace: false, version: nil)
103103
execute %!CREATE STATISTICS my_stats ON "Id", "UserId" FROM "Posts"!
104104

105-
if server_version_num >= 120000 && !trigger_based
105+
if !trigger_based
106106
execute %!ALTER TABLE "Posts" ADD COLUMN "Gen" INTEGER GENERATED ALWAYS AS ("Id" * 10) STORED!
107107
end
108108

@@ -210,7 +210,7 @@ def assert_period(period, column: "createdAt", trigger_based: false, tablespace:
210210
run_command "analyze Posts --swapped"
211211

212212
# pg_stats_ext view available with Postgres 12+
213-
assert_statistics "Posts" if server_version_num >= 120000 && !trigger_based
213+
assert_statistics "Posts" if !trigger_based
214214

215215
# TODO check sequence ownership
216216
run_command "unswap Posts"

0 commit comments

Comments
 (0)