From 163a33ae3a33396c370fc927a53d176da7034858 Mon Sep 17 00:00:00 2001 From: snpaul22 <92539849+snpaul22@users.noreply.github.com> Date: Sat, 4 May 2024 11:27:50 -0400 Subject: [PATCH] Create init.sql Script checks for "app" schema in Postgres during startup. It will create the schema automatically if it doesn't exist or skip if it does exist. --- init.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 init.sql diff --git a/init.sql b/init.sql new file mode 100644 index 0000000..dc88439 --- /dev/null +++ b/init.sql @@ -0,0 +1,6 @@ +DO $$ +BEGIN + IF NOT EXISTS (SELECT schema_name FROM information_schema.schemata WHERE schema_name = 'app') THEN + CREATE SCHEMA app; + END IF; +END $$;