Skip to content

Commit 1a34fdd

Browse files
encimajfroche
authored andcommitted
add tests for pg_partman
1 parent de0c1ac commit 1a34fdd

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

migrations/schema.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ CREATE EXTENSION IF NOT EXISTS pg_graphql WITH SCHEMA graphql;
7878

7979
COMMENT ON EXTENSION pg_graphql IS 'pg_graphql: GraphQL support';
8080

81+
--
82+
-- Name: pg_partman; Type: EXTENSION; Schema: -; Owner: -
83+
--
84+
85+
CREATE SCHEMA partman;
86+
CREATE EXTENSION pg_partman SCHEMA partman;
8187

8288
--
8389
-- Name: pg_stat_statements; Type: EXTENSION; Schema: -; Owner: -

nix/tests/expected/pg_partman.out

Whitespace-only changes.

nix/tests/sql/pg_partman.sql

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
CREATE SCHEMA IF NOT EXISTS partman_test;
2+
3+
CREATE TABLE partman_test.time_taptest_table
4+
(col1 int,
5+
col2 text default 'stuff',
6+
col3 timestamptz NOT NULL DEFAULT now())
7+
PARTITION BY RANGE (col3);
8+
9+
CREATE INDEX ON partman_test.time_taptest_table (col3);
10+
11+
CREATE TABLE partman_test.time_taptest_table_template (LIKE partman_test.time_taptest_table);
12+
13+
ALTER TABLE partman_test.time_taptest_table_template ADD PRIMARY KEY (col1);
14+
15+
SELECT partman.create_parent(
16+
p_parent_table := 'partman_test.time_taptest_table'
17+
, p_control := 'col3'
18+
, p_interval := '1 day'
19+
, p_template_table := 'partman_test.time_taptest_table_template'
20+
);

0 commit comments

Comments
 (0)