From 86e140f4d97840f4c192c5e1753cd71d46f82d97 Mon Sep 17 00:00:00 2001 From: Toon Willems Date: Tue, 3 Dec 2024 20:22:47 +0100 Subject: [PATCH] Fix schema dump not including extension --- config/database.yml | 1 - db/structure.sql | 33 ++++++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/config/database.yml b/config/database.yml index 26c6290435e..a9fee607e20 100644 --- a/config/database.yml +++ b/config/database.yml @@ -9,7 +9,6 @@ development: password: changeme database: lago port: 5432 - schema_search_path: 'public' events: <<: *default host: db diff --git a/db/structure.sql b/db/structure.sql index 871d8986ec7..c957117d591 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -556,19 +556,42 @@ DROP TYPE IF EXISTS public.subscription_invoicing_reason; DROP TYPE IF EXISTS public.customer_type; DROP TYPE IF EXISTS public.billable_metric_weighted_interval; DROP TYPE IF EXISTS public.billable_metric_rounding_function; -DROP SCHEMA IF EXISTS public; +DROP EXTENSION IF EXISTS unaccent; +DROP EXTENSION IF EXISTS pgcrypto; +-- *not* dropping schema, since initdb creates it -- -- Name: public; Type: SCHEMA; Schema: -; Owner: - -- -CREATE SCHEMA public; +-- *not* creating schema, since initdb creates it -- --- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: - +-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: - -- -COMMENT ON SCHEMA public IS 'standard public schema'; +CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public; + + +-- +-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions'; + + +-- +-- Name: unaccent; Type: EXTENSION; Schema: -; Owner: - +-- + +CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public; + + +-- +-- Name: EXTENSION unaccent; Type: COMMENT; Schema: -; Owner: - +-- + +COMMENT ON EXTENSION unaccent IS 'text search dictionary that removes accents'; -- @@ -5593,7 +5616,7 @@ ALTER TABLE ONLY public.adjusted_fees -- PostgreSQL database dump complete -- -SET search_path TO public; +SET search_path TO "$user", public; INSERT INTO "schema_migrations" (version) VALUES ('20241203141040'),