From f38a6afabe5f513da2e29a2f942f5173f574e448 Mon Sep 17 00:00:00 2001 From: "Sergio C. Arteaga" Date: Tue, 14 Dec 2021 14:46:37 +0100 Subject: [PATCH] Create partman schema (#1747) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sergio CastaƱo Arteaga --- database/migrations/schema/034_partman_schema.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 database/migrations/schema/034_partman_schema.sql diff --git a/database/migrations/schema/034_partman_schema.sql b/database/migrations/schema/034_partman_schema.sql new file mode 100644 index 00000000..d63723a8 --- /dev/null +++ b/database/migrations/schema/034_partman_schema.sql @@ -0,0 +1,12 @@ +drop extension pg_partman; +create schema partman; +create extension pg_partman schema partman; +drop table template_public_package_views; +select partman.create_parent('public.package_views', 'day', 'native', 'monthly', p_start_partition := current_date::text); + +---- create above / drop below ---- + +drop extension pg_partman; +drop schema partman cascade; +create extension pg_partman; +select create_parent('public.package_views', 'day', 'native', 'monthly', p_start_partition := current_date::text);