-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a static SQL dump to seed the ffs_postgres database
- Loading branch information
1 parent
3895edc
commit 07b6493
Showing
6 changed files
with
120 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 0 additions & 50 deletions
50
src/featureflagservice/priv/repo/migrations/20220524172636_create_featureflags.exs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM postgres:16.1 | ||
WORKDIR /app | ||
COPY ./src/ffs_postgres/init.sh /docker-entrypoint-initdb.d | ||
COPY ./src/ffs_postgres/dump.sql ./dump.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
-- Dumped from database version 16.1 (Debian 16.1-1.pgdg120+1) | ||
-- Dumped by pg_dump version 16.1 | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET idle_in_transaction_session_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SELECT pg_catalog.set_config('search_path', '', false); | ||
SET check_function_bodies = false; | ||
SET xmloption = content; | ||
SET client_min_messages = warning; | ||
SET row_security = off; | ||
|
||
SET default_tablespace = ''; | ||
|
||
SET default_table_access_method = heap; | ||
|
||
-- | ||
-- Name: featureflags; Type: TABLE; Schema: public; Owner: ffs | ||
-- | ||
|
||
CREATE TABLE public.featureflags ( | ||
id bigint NOT NULL, | ||
name character varying(255), | ||
description character varying(255), | ||
enabled double precision DEFAULT 0.0 NOT NULL, | ||
inserted_at timestamp(0) without time zone NOT NULL, | ||
updated_at timestamp(0) without time zone NOT NULL | ||
); | ||
|
||
|
||
ALTER TABLE public.featureflags OWNER TO ffs; | ||
|
||
-- | ||
-- Name: featureflags_id_seq; Type: SEQUENCE; Schema: public; Owner: ffs | ||
-- | ||
|
||
CREATE SEQUENCE public.featureflags_id_seq | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
|
||
ALTER SEQUENCE public.featureflags_id_seq OWNER TO ffs; | ||
|
||
-- | ||
-- Name: featureflags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: ffs | ||
-- | ||
|
||
ALTER SEQUENCE public.featureflags_id_seq OWNED BY public.featureflags.id; | ||
|
||
|
||
ALTER TABLE public.schema_migrations OWNER TO ffs; | ||
|
||
-- | ||
-- Name: featureflags id; Type: DEFAULT; Schema: public; Owner: ffs | ||
-- | ||
|
||
ALTER TABLE ONLY public.featureflags ALTER COLUMN id SET DEFAULT nextval('public.featureflags_id_seq'::regclass); | ||
|
||
|
||
-- | ||
-- Data for Name: featureflags; Type: TABLE DATA; Schema: public; Owner: ffs | ||
-- | ||
|
||
COPY public.featureflags (id, name, description, enabled, inserted_at, updated_at) FROM stdin; | ||
1 productCatalogFailure Fail product catalog service on a specific product 0 2024-01-07 20:06:29 2024-01-07 20:06:29 | ||
2 recommendationCache Cache recommendations 0 2024-01-07 20:06:29 2024-01-07 20:06:29 | ||
3 adServiceFailure Fail ad service requests sporadically 0 2024-01-07 20:06:29 2024-01-07 20:06:29 | ||
4 cartServiceFailure Fail cart service requests sporadically 0 2024-01-07 20:06:29 2024-01-07 20:06:29 | ||
\. | ||
|
||
|
||
-- | ||
-- Name: featureflags_id_seq; Type: SEQUENCE SET; Schema: public; Owner: ffs | ||
-- | ||
|
||
SELECT pg_catalog.setval('public.featureflags_id_seq', 4, true); | ||
|
||
|
||
-- | ||
-- Name: featureflags featureflags_pkey; Type: CONSTRAINT; Schema: public; Owner: ffs | ||
-- | ||
|
||
ALTER TABLE ONLY public.featureflags | ||
ADD CONSTRAINT featureflags_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- Name: featureflags_name_index; Type: INDEX; Schema: public; Owner: ffs | ||
-- | ||
|
||
CREATE UNIQUE INDEX featureflags_name_index ON public.featureflags USING btree (name); | ||
|
||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
psql -U $POSTGRES_USER -d $POSTGRES_DB -a -f /app/dump.sql | ||
|