Skip to content

[WIP] Add PostgreSQL, H2 (for testing), and environment configuration support#5

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/fix-77a2713b-cc2c-4e3a-a4dd-1c1075b9a02c
Closed

[WIP] Add PostgreSQL, H2 (for testing), and environment configuration support#5
Copilot wants to merge 1 commit intomainfrom
copilot/fix-77a2713b-cc2c-4e3a-a4dd-1c1075b9a02c

Conversation

Copy link
Contributor

Copilot AI commented Sep 27, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

Currently, the Spring Boot application is using default settings and does not have proper database configuration for development, testing, and production. We want to add support for:

  1. PostgreSQL as the primary database for development and production.
  2. H2 in-memory database for testing purposes.
  3. .env or Spring Boot environment-based configuration to manage DB credentials and other secrets securely.

Tasks:

  • Add PostgreSQL dependency in pom.xml.
  • Add H2 dependency for testing.
  • Configure application.properties or application.yml for multiple environments (dev, test, prod).
  • Support loading environment variables from .env or OS environment.
  • Ensure spring.jpa.hibernate.ddl-auto is set appropriately for each environment (update for dev, create-drop for test, validate for prod).
  • Verify database connections in all environments.

Acceptance Criteria:

  • The app can connect to PostgreSQL in dev/production.
  • Tests run against H2 in-memory DB.
  • DB credentials and sensitive info are loaded from environment variables.
  • Documentation updated with steps to configure local .env and run the app.
Original prompt

This section details on the original issue you should resolve

<issue_title>Add PostgreSQL, H2 (for testing), and environment configuration support</issue_title>
<issue_description>
Currently, the Spring Boot application is using default settings and does not have proper database configuration for development, testing, and production. We want to add support for:

  1. PostgreSQL as the primary database for development and production.
  2. H2 in-memory database for testing purposes.
  3. .env or Spring Boot environment-based configuration to manage DB credentials and other secrets securely.

Tasks:

  • Add PostgreSQL dependency in pom.xml.
  • Add H2 dependency for testing.
  • Configure application.properties or application.yml for multiple environments (dev, test, prod).
  • Support loading environment variables from .env or OS environment.
  • Ensure spring.jpa.hibernate.ddl-auto is set appropriately for each environment (update for dev, create-drop for test, validate for prod).
  • Verify database connections in all environments.

Acceptance Criteria:

  • The app can connect to PostgreSQL in dev/production.
  • Tests run against H2 in-memory DB.
  • DB credentials and sensitive info are loaded from environment variables.
  • Documentation updated with steps to configure local .env and run the app.
    </issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #4

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PostgreSQL, H2 (for testing), and environment configuration support

2 participants