Use persistent database and add datasource

This commit is contained in:
Torge Hamann 2024-11-17 19:52:58 +01:00
parent 4d04fc64aa
commit 59949e067b
3 changed files with 19 additions and 3 deletions

3
.gitignore vendored
View file

@ -19,6 +19,7 @@ bin/
### IntelliJ IDEA ### ### IntelliJ IDEA ###
.idea .idea
!.idea/dataSources.xml
*.iws *.iws
*.iml *.iml
*.ipr *.ipr
@ -37,4 +38,4 @@ out/
.vscode/ .vscode/
### SQLite DB ### ### SQLite DB ###
sqlLiteDb sqLiteDb.db

15
.idea/dataSources.xml generated Normal file
View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="Database" uuid="f67a83d5-9533-4a9b-acc4-588c2d1ee383">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:sqLiteDb.db</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View file

@ -2,12 +2,12 @@
spring.application.name=home-cert-assistant spring.application.name=home-cert-assistant
# Database # Database
driverClassName=org.sqlite.JDBC driverClassName=org.sqlite.JDBC
url=jdbc:sqlite:sqlLiteDb:database?cache=shared url=jdbc:sqlite:sqLiteDb.db
username=admin username=admin
password=admin password=admin
spring.jpa.database-platform=org.hibernate.community.dialect.SQLiteDialect spring.jpa.database-platform=org.hibernate.community.dialect.SQLiteDialect
#TODO: Use flyway for db setup #TODO: Use flyway for db setup
hibernate.hbm2ddl.auto=create-drop hibernate.hbm2ddl.auto=update
hibernate.show_sql=true hibernate.show_sql=true
# Logging # Logging