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.
This commit is contained in:
snpaul22 2024-05-04 11:27:50 -04:00 committed by GitHub
parent 37d064aa62
commit 163a33ae3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

6
init.sql Normal file
View File

@ -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 $$;