diff --git a/backend/build.gradle b/backend/build.gradle index 3a7f6920a..ce4240209 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -28,6 +28,8 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-validation' + implementation 'mysql:mysql-connector-java:8.0.32' + annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' diff --git a/backend/src/main/resources/application-dev.yml b/backend/src/main/resources/application-dev.yml new file mode 100644 index 000000000..ccee44470 --- /dev/null +++ b/backend/src/main/resources/application-dev.yml @@ -0,0 +1,21 @@ +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + url: ${MYSQL_DATABASE_URL} + username: ${MYSQL_DATABASE_USER_NAME} + password: ${MYSQL_DATABASE_PASSWORD} + jpa: + properties: + hibernate: + format_sql: true + show-sql: true + hibernate: + ddl-auto: none +logging: + level: + org: + hibernate: + type: + descriptor: + sql: + BasicBinder: TRACE diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties deleted file mode 100644 index 91734ebef..000000000 --- a/backend/src/main/resources/application.properties +++ /dev/null @@ -1,9 +0,0 @@ -spring.datasource.url=jdbc:h2:mem:mapbefine;MODE=MySQL -#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL57Dialect -spring.datasource.username=sa -spring.jpa.properties.hibernate.format_sql=true -spring.jpa.show-sql=true -logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE -spring.jpa.hibernate.ddl-auto=create -spring.h2.console.enabled=true -spring.h2.console.path=/h2-console diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml new file mode 100644 index 000000000..3a8259581 --- /dev/null +++ b/backend/src/main/resources/application.yml @@ -0,0 +1,23 @@ +spring: + datasource: + username: sa + url: jdbc:h2:mem:mapbefine;MODE=MySQL + h2: + console: + enabled: true + path: /h2-console + jpa: + properties: + hibernate: + format_sql: true + show-sql: true + hibernate: + ddl-auto: create +logging: + level: + org: + hibernate: + type: + descriptor: + sql: + BasicBinder: TRACE