#141_Create_new_databases #180

Merged
c24elipe merged 3 commits from #141_Create_new_databases into team_2_week_1 2026-04-08 23:03:51 +00:00
Collaborator

Solution:
Added support for creating multiple PostgresSQL databases using an initialization script instead of relying solely on POSTGRES_DB.

Changes

  • made init SQL script in docker_postgres_init.sql
  • Configured Docker Compose to mount the script

Notes

  • The database called referenced in POSTGRES_DB will always be the root/head database.
**Solution**: Added support for creating multiple PostgresSQL databases using an initialization script instead of relying solely on POSTGRES_DB. **Changes** - made init SQL script in docker_postgres_init.sql - Configured Docker Compose to mount the script **Notes** - The database called referenced in POSTGRES_DB will always be the root/head database.
Collaborator

Tests done:

  1. Overlook the "DockerCompose/compose.yaml" file for related syntax errors.
  2. I ran the container and overlooked the logs.
  3. I used software to inspect the DB to make sure that a temporary table I added in the SQL file is added to the DB.

The observed results:

  1. No syntax errors found.
  2. In the logs, it mounts and executes the "docker_postgres_init.sql" file:
PostgreSQL  |  done
PostgreSQL  | server started
PostgreSQL  | CREATE DATABASE
PostgreSQL  | 
PostgreSQL  | 
PostgreSQL  | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/docker_postgres_init.sql
PostgreSQL  | CREATE TABLE
PostgreSQL  | 

NOTE that a basic example table was added for the next step. That is why "CREATE TABLE" appears in the logs.

  1. As shown above, the example table created is added to the database when inspected.

NOTE 2 The test SQL code is not pushed and was only used to test locally.

image
image

Tests done: 1. Overlook the "DockerCompose/compose.yaml" file for related syntax errors. 2. I ran the container and overlooked the logs. 3. I used software to inspect the DB to make sure that a temporary table I added in the SQL file is added to the DB. The observed results: 1. No syntax errors found. 2. In the logs, it mounts and executes the "docker_postgres_init.sql" file: ```Bash PostgreSQL | done PostgreSQL | server started PostgreSQL | CREATE DATABASE PostgreSQL | PostgreSQL | PostgreSQL | /usr/local/bin/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/docker_postgres_init.sql PostgreSQL | CREATE TABLE PostgreSQL | ``` **NOTE** that a basic example table was added for the next step. That is why "CREATE TABLE" appears in the logs. 3. As shown above, the example table created is added to the database when inspected. **NOTE 2** The test SQL code is not pushed and was only used to test locally. ![image](/attachments/a1504b12-3547-4e57-8ced-8401abf15092) ![image](/attachments/875b5f32-f085-411e-adcd-ab5bf7a031d6)
c24elipe merged commit 2bff95c300 into team_2_week_1 2026-04-08 23:03:51 +00:00
c24elipe deleted branch #141_Create_new_databases 2026-04-08 23:03:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Andras/BoundlessFlowCampus2K!180
No description provided.