diff --git a/build.gradle b/build.gradle index 641ccee..6632356 100644 --- a/build.gradle +++ b/build.gradle @@ -31,6 +31,7 @@ dependencies { implementation 'org.springframework.boot:spring-boot-starter-validation' compileOnly 'org.projectlombok:lombok' runtimeOnly 'com.mysql:mysql-connector-j' + runtimeOnly 'com.h2database:h2' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' diff --git a/src/main/java/com/umc/hackaton/snapspot/config/entity/BaseEntity.java b/src/main/java/com/umc/hackaton/snapspot/config/entity/BaseEntity.java index 7516f39..242d783 100644 --- a/src/main/java/com/umc/hackaton/snapspot/config/entity/BaseEntity.java +++ b/src/main/java/com/umc/hackaton/snapspot/config/entity/BaseEntity.java @@ -22,6 +22,6 @@ public abstract class BaseEntity { @Column(name = "updated_at") private LocalDateTime updatedAt; - @Column(name = "deleted", nullable = false, columnDefinition = "bit(1) default 0") + @Column(name = "deleted", nullable = false) private Boolean isDeleted = false; } diff --git a/src/main/java/com/umc/hackaton/snapspot/user/entity/User.java b/src/main/java/com/umc/hackaton/snapspot/user/entity/User.java index 8b5a799..a37e667 100644 --- a/src/main/java/com/umc/hackaton/snapspot/user/entity/User.java +++ b/src/main/java/com/umc/hackaton/snapspot/user/entity/User.java @@ -12,6 +12,7 @@ @Builder @AllArgsConstructor @NoArgsConstructor +@Table(name="Users") public class User extends BaseEntity { @Id diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9c4433f..d9b562f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,10 +1,15 @@ spring: datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - url: ${MYSQL_DATABASE} - username: ${MYSQL_USER} - password: ${MYSQL_PASSWORD} - +# driver-class-name: com.mysql.cj.jdbc.Driver +# url: jdbc:mysql://localhost:3306/spot?useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:h2:mem:spotdb + username: root + password: + driver-class-name: org.h2.Driver + h2: + console: + enabled: true + path: /h2-console jpa: hibernate: ddl-auto: update @@ -12,4 +17,17 @@ spring: physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl show-sql: true properties: - hibernate.dialect: org.hibernate.dialect.MySQLDialect + hibernate: + dialect: org.hibernate.dialect.H2Dialect + format_sql: true + show_sql: true +# properties: +# hibernate.dialect: org.hibernate.dialect.MySQLDialect +# jpa: +# hibernate: +# ddl-auto: update +# naming: +# physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl +# show-sql: true +# properties: +# hibernate.dialect: org.hibernate.dialect.MySQLDialect \ No newline at end of file