Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persistent h2 #36

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ mvnw
mvnw.cmd

.idea

data/
pgdata/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ mvn clean install
java -jar target/job-winner-0.0.1-SNAPSHOT.jar
```

Alternatively, you can run the java app with h2 database:
```console
# Initializing and Running the Application with H2 Database (first time only)
java -jar target/job-winner-0.0.1-SNAPSHOT.jar --spring.profiles.active=h2 --spring.sql.init.mode=always

# Starting the Application When Database Already Exists
java -jar target/job-winner-0.0.1-SNAPSHOT.jar --spring.profiles.active=h2
```
Please follow the build instruction from the [UI repo](https://github.com/januschung/job-winner-ui) to bring up the UI.

## Contributing
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/application-h2.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
spring.r2dbc.url=r2dbc:h2:mem:///job-winner?options=DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.r2dbc.url=r2dbc:h2:file:///./data/job-winner
spring.r2dbc.username=sa
spring.r2dbc.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.hibernate.ddl-auto=none