Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/op 1360 #9

Merged
merged 7 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM postgres:13-alpine


# Script to detect whether the database has finished initializing
COPY ["true_isready.sh", "/usr/local/bin/"]
COPY ["database scripts/00_dump.sql", "database scripts/0[2345]_*.sql", "database scripts/demo_db.sql", "/docker-entrypoint-initdb.d/"]
1 change: 1 addition & 0 deletions database scripts/00_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4048,6 +4048,7 @@ CREATE TABLE "public"."tblPremium" (
"AuditUserID" integer NOT NULL,
"PayerID" integer,
"PolicyID" integer NOT NULL,
"CreatedDate" date DEFAULT CURRENT_DATE NOT NULL,
"RowID" "text"
);

Expand Down
46 changes: 23 additions & 23 deletions database scripts/01_modular_base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,24 @@ CREATE TABLE "public"."core_User" (

--
-- TOC entry 214 (class 1259 OID 20299)
-- Name: core_User_groups; Type: TABLE; Schema: public; Owner: postgres
-- Name: Core_User_groups; Type: TABLE; Schema: public; Owner: postgres
--

CREATE TABLE "public"."core_User_groups" (
CREATE TABLE "public"."Core_User_groups" (
"id" integer NOT NULL,
"user_id" "uuid" NOT NULL,
"group_id" integer NOT NULL
);


-- ALTER TABLE "public"."core_User_groups" OWNER TO "postgres";
-- ALTER TABLE "public"."Core_User_groups" OWNER TO "postgres";

--
-- TOC entry 213 (class 1259 OID 20297)
-- Name: core_User_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
-- Name: Core_User_groups_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--

CREATE SEQUENCE "public"."core_User_groups_id_seq"
CREATE SEQUENCE "public"."Core_User_groups_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
Expand All @@ -213,15 +213,15 @@ CREATE SEQUENCE "public"."core_User_groups_id_seq"
CACHE 1;


-- ALTER TABLE "public"."core_User_groups_id_seq" OWNER TO "postgres";
-- ALTER TABLE "public"."Core_User_groups_id_seq" OWNER TO "postgres";

--
-- TOC entry 3994 (class 0 OID 0)
-- Dependencies: 213
-- Name: core_User_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
-- Name: Core_User_groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--

ALTER SEQUENCE "public"."core_User_groups_id_seq" OWNED BY "public"."core_User_groups"."id";
ALTER SEQUENCE "public"."Core_User_groups_id_seq" OWNED BY "public"."Core_User_groups"."id";


--
Expand Down Expand Up @@ -397,20 +397,20 @@ ALTER TABLE ONLY "public"."core_TechnicalUser"

--
-- TOC entry 3402 (class 2606 OID 20304)
-- Name: core_User_groups core_User_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
-- Name: Core_User_groups Core_User_groups_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY "public"."core_User_groups"
ADD CONSTRAINT "core_User_groups_pkey" PRIMARY KEY ("id");
ALTER TABLE ONLY "public"."Core_User_groups"
ADD CONSTRAINT "Core_User_groups_pkey" PRIMARY KEY ("id");


--
-- TOC entry 3405 (class 2606 OID 20410)
-- Name: core_User_groups core_User_groups_user_id_group_id_8ec5911a_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres
-- Name: Core_User_groups Core_User_groups_user_id_group_id_8ec5911a_uniq; Type: CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY "public"."core_User_groups"
ADD CONSTRAINT "core_User_groups_user_id_group_id_8ec5911a_uniq" UNIQUE ("user_id", "group_id");
ALTER TABLE ONLY "public"."Core_User_groups"
ADD CONSTRAINT "Core_User_groups_user_id_group_id_8ec5911a_uniq" UNIQUE ("user_id", "group_id");


--
Expand Down Expand Up @@ -484,18 +484,18 @@ CREATE INDEX "core_TechnicalUser_username_6f41c923_like" ON "public"."core_Techn

--
-- TOC entry 3400 (class 1259 OID 20412)
-- Name: core_User_groups_group_id_197830ae; Type: INDEX; Schema: public; Owner: postgres
-- Name: Core_User_groups_group_id_197830ae; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX "core_User_groups_group_id_197830ae" ON "public"."core_User_groups" USING "btree" ("group_id");
CREATE INDEX "Core_User_groups_group_id_197830ae" ON "public"."Core_User_groups" USING "btree" ("group_id");


--
-- TOC entry 3403 (class 1259 OID 20411)
-- Name: core_User_groups_user_id_06a128ce; Type: INDEX; Schema: public; Owner: postgres
-- Name: Core_User_groups_user_id_06a128ce; Type: INDEX; Schema: public; Owner: postgres
--

CREATE INDEX "core_User_groups_user_id_06a128ce" ON "public"."core_User_groups" USING "btree" ("user_id");
CREATE INDEX "Core_User_groups_user_id_06a128ce" ON "public"."Core_User_groups" USING "btree" ("user_id");


--
Expand Down Expand Up @@ -589,11 +589,11 @@ ALTER TABLE ONLY "public"."core_Mutation_Log"

--
-- TOC entry 3727 (class 2606 OID 20399)
-- Name: core_User_groups core_User_groups_user_id_06a128ce_fk_core_User_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
-- Name: Core_User_groups Core_User_groups_user_id_06a128ce_fk_core_User_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY "public"."core_User_groups"
ADD CONSTRAINT "core_User_groups_user_id_06a128ce_fk_core_User_id" FOREIGN KEY ("user_id") REFERENCES "public"."core_User"("id") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY "public"."Core_User_groups"
ADD CONSTRAINT "Core_User_groups_user_id_06a128ce_fk_core_User_id" FOREIGN KEY ("user_id") REFERENCES "public"."core_User"("id") DEFERRABLE INITIALLY DEFERRED;


--
Expand Down Expand Up @@ -699,10 +699,10 @@ ALTER TABLE ONLY "public"."insuree_InsureeMutation"

--
-- TOC entry 3329 (class 2604 OID 20302)
-- Name: core_User_groups id; Type: DEFAULT; Schema: public; Owner: postgres
-- Name: Core_User_groups id; Type: DEFAULT; Schema: public; Owner: postgres
--

ALTER TABLE ONLY "public"."core_User_groups" ALTER COLUMN "id" SET DEFAULT "nextval"('"public"."core_User_groups_id_seq"'::"regclass");
ALTER TABLE ONLY "public"."Core_User_groups" ALTER COLUMN "id" SET DEFAULT "nextval"('"public"."Core_User_groups_id_seq"'::"regclass");


--
Expand Down
7 changes: 7 additions & 0 deletions true_isready.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
if [[ $(pgrep -f docker-entrypoint-initdb.d) == "" ]]
then
exit 0
else
exit 1
fi