Skip to content

Commit c9aec87

Browse files
JIWONKIMSclaude
andcommitted
fix: Disable Spring AI schema auto-initialization for PostgreSQL
Spring AI was attempting to execute H2-specific schema (schema-h2.sql) on PostgreSQL, causing infinite restart loop due to unsupported CLOB type. Changes: - Set spring.sql.init.mode to never in application.yml - Add spring.ai.vectorstore.jdbc.initialize-schema: false in application-prod.yml - Remove schema-locations pointing to H2 schema Fixes database initialization error: type "clob" does not exist 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dd6366c commit c9aec87

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/resources/application-prod.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ spring:
1515
format_sql: true
1616
dialect: org.hibernate.dialect.PostgreSQLDialect
1717

18+
ai:
19+
vectorstore:
20+
jdbc:
21+
initialize-schema: false
22+
1823
data:
1924
redis:
2025
host: ${REDIS_HOST}

src/main/resources/application.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ spring:
5454

5555
sql:
5656
init:
57-
mode: always
58-
schema-locations: classpath:org/springframework/ai/chat/memory/repository/jdbc/schema-h2.sql
57+
mode: never # prod에서는 Hibernate가 스키마 관리
5958

6059
# WebSocket 설정 (Guest-Guide 채팅용)
6160
websocket:

0 commit comments

Comments
 (0)