Real PostgreSQL 16 and Redis Stack 7.4; 24 tests write output/01-24. Covers the 20-message default window with no property, the 36-character conversation_id, tool messages dropped by JdbcChatMemoryRepository, concurrent add() on one conversation, a 1.x table under the 2.0 repository, the Redis repository silently backing off for a custom ChatMemory, and the removal of PromptChatMemoryAdvisor. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ja4jkzrbQ4LQZBNrb5mkZE
17 lines
798 B
Plaintext
17 lines
798 B
Plaintext
# A Spring AI 1.x table under the 2.0 repository
|
|
|
|
A 1.1.x-shaped table (no sequence_id column) holds 2 rows for "old-conv".
|
|
|
|
2.0.1 repository, findByConversationId("old-conv"):
|
|
ERROR: column "sequence_id" does not exist
|
|
|
|
Migration: add the column, backfill it from the timestamp order, then make it NOT NULL:
|
|
ALTER TABLE SPRING_AI_CHAT_MEMORY ADD COLUMN sequence_id BIGINT
|
|
UPDATE SPRING_AI_CHAT_MEMORY m SET sequence_id = s.rn FROM (SELECT ctid AS c, row_number() OVER (PARTITION ...
|
|
ALTER TABLE SPRING_AI_CHAT_MEMORY ALTER COLUMN sequence_id SET NOT NULL
|
|
CREATE INDEX IF NOT EXISTS SPRING_AI_CHAT_MEMORY_CONVERSATION_ID_SEQUENCE_ID_IDX ON SPRING_AI_CHAT_MEMORY(c...
|
|
|
|
findByConversationId("old-conv") after the migration:
|
|
USER My name is Priya
|
|
ASSISTANT Nice to meet you, Priya.
|