Add datetime format migration for doc status table
This commit is contained in:
parent
910c6973f3
commit
57c8c19628
1 changed files with 3 additions and 1 deletions
|
|
@ -180,6 +180,7 @@ class PostgreSQLDB:
|
||||||
"LIGHTRAG_VDB_ENTITY": ["create_time", "update_time"],
|
"LIGHTRAG_VDB_ENTITY": ["create_time", "update_time"],
|
||||||
"LIGHTRAG_VDB_RELATION": ["create_time", "update_time"],
|
"LIGHTRAG_VDB_RELATION": ["create_time", "update_time"],
|
||||||
"LIGHTRAG_DOC_CHUNKS": ["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():
|
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"""
|
"""Convert datetime to ISO format string with timezone info"""
|
||||||
if dt is None:
|
if dt is None:
|
||||||
return 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:
|
if dt.tzinfo is None:
|
||||||
dt = dt.replace(tzinfo=timezone.utc)
|
dt = dt.replace(tzinfo=timezone.utc)
|
||||||
|
# If datetime already has timezone info, keep it as is
|
||||||
return dt.isoformat()
|
return dt.isoformat()
|
||||||
|
|
||||||
async def initialize(self):
|
async def initialize(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue