Skip to content

Commit cd366b4

Browse files
committed
Fix: MySQL/MariaDB TIMESTAMP precision for message ordering (#3442)
Fixes #3442 Signed-off-by: Seungwon Lee <aahhll654@gmail.com>
1 parent 4621c81 commit cd366b4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-mariadb.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS SPRING_AI_CHAT_MEMORY (
22
conversation_id VARCHAR(36) NOT NULL,
33
content TEXT NOT NULL,
44
type VARCHAR(10) NOT NULL,
5-
`timestamp` TIMESTAMP NOT NULL,
5+
`timestamp` TIMESTAMP(3) NOT NULL,
66
CONSTRAINT TYPE_CHECK CHECK (type IN ('USER', 'ASSISTANT', 'SYSTEM', 'TOOL'))
77
);
88

memory/repository/spring-ai-model-chat-memory-repository-jdbc/src/main/resources/org/springframework/ai/chat/memory/repository/jdbc/schema-mysql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ CREATE TABLE IF NOT EXISTS SPRING_AI_CHAT_MEMORY (
22
`conversation_id` VARCHAR(36) NOT NULL,
33
`content` TEXT NOT NULL,
44
`type` ENUM('USER', 'ASSISTANT', 'SYSTEM', 'TOOL') NOT NULL,
5-
`timestamp` TIMESTAMP NOT NULL,
5+
`timestamp` TIMESTAMP(3) NOT NULL,
66

77
INDEX `SPRING_AI_CHAT_MEMORY_CONVERSATION_ID_TIMESTAMP_IDX` (`conversation_id`, `timestamp`)
88
);

0 commit comments

Comments
 (0)