From 57c8c19628ca6e57e72680a0e2caaad4289a3c17 Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 16 Jul 2025 22:21:51 +0800 Subject: [PATCH] Add datetime format migration for doc status table --- lightrag/kg/postgres_impl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lightrag/kg/postgres_impl.py b/lightrag/kg/postgres_impl.py index 4f9131d2..f77d6bd0 100644 --- a/lightrag/kg/postgres_impl.py +++ b/lightrag/kg/postgres_impl.py @@ -180,6 +180,7 @@ class PostgreSQLDB: "LIGHTRAG_VDB_ENTITY": ["create_time", "update_time"], "LIGHTRAG_VDB_RELATION": ["create_time", "update_time"], "LIGHTRAG_DOC_CHUNKS": ["create_time", "update_time"], + "LIGHTRAG_DOC_STATUS": ["created_at", "updated_at"], } for table_name, columns in tables_to_migrate.items(): @@ -1462,9 +1463,10 @@ class PGDocStatusStorage(DocStatusStorage): """Convert datetime to ISO format string with timezone info""" if dt is None: return None - # If no timezone info, assume it's UTC time + # If no timezone info, assume it's UTC time (as stored in database) if dt.tzinfo is None: dt = dt.replace(tzinfo=timezone.utc) + # If datetime already has timezone info, keep it as is return dt.isoformat() async def initialize(self):