Skip to content

Commit b3b0a4d

Browse files
JIWONKIMSclaude
andcommitted
fix: Resolve Redis Repository warnings and reset database schema
- Add @EnableRedisRepositories with empty package to prevent JPA repositories from being scanned as Redis repositories - Add @EnableCaching annotation for explicit cache enabling - Temporarily set ddl-auto to create for database schema reset 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 63bd077 commit b3b0a4d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/main/kotlin/com/back/koreaTravelGuide/common/config/RedisConfig.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.module.kotlin.KotlinModule
99
import org.springframework.beans.factory.annotation.Value
1010
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
1111
import org.springframework.cache.CacheManager
12+
import org.springframework.cache.annotation.EnableCaching
1213
import org.springframework.context.annotation.Bean
1314
import org.springframework.context.annotation.Configuration
1415
import org.springframework.data.redis.cache.RedisCacheConfiguration
@@ -17,12 +18,15 @@ import org.springframework.data.redis.connection.RedisConnectionFactory
1718
import org.springframework.data.redis.connection.RedisStandaloneConfiguration
1819
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory
1920
import org.springframework.data.redis.core.RedisTemplate
21+
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories
2022
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer
2123
import org.springframework.data.redis.serializer.RedisSerializationContext
2224
import org.springframework.data.redis.serializer.StringRedisSerializer
2325
import java.time.Duration
2426

2527
@Configuration
28+
@EnableCaching
29+
@EnableRedisRepositories(basePackages = ["nowhere"])
2630
class RedisConfig {
2731
@Value("\${spring.data.redis.host:localhost}")
2832
private lateinit var redisHost: String

src/main/resources/application-prod.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spring:
99

1010
jpa:
1111
hibernate:
12-
ddl-auto: update
12+
ddl-auto: create
1313
properties:
1414
hibernate:
1515
format_sql: true

0 commit comments

Comments
 (0)