Merge pull request #508 from snpaul22/main

Create app schema automatically
This commit is contained in:
Hargata Softworks
2024-07-06 17:40:13 -06:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ services:
POSTGRES_PASSWORD: "lubepass"
POSTGRES_DB: "lubelogger"
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro

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