Skip to content

Commit

Permalink
Merge pull request #508 from snpaul22/main
Browse files Browse the repository at this point in the history
Create app schema automatically
  • Loading branch information
hargata authored Jul 6, 2024
2 parents 0d3c04d + 5148338 commit 9dcdcf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose.postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions init.sql
Original file line number Diff line number Diff line change
@@ -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 $$;

0 comments on commit 9dcdcf9

Please sign in to comment.