From bd1678cfe8b8129166668eeab5d787cab2a5ee95 Mon Sep 17 00:00:00 2001 From: iFixKart Dev Date: Wed, 18 Nov 2026 18:00:20 +0530 Subject: [PATCH] fix(audit): widen action column to VARCHAR(100) to support order_status_ready_for_delivery --- app/core/database/db_session.py | 2 +- app/models/AuditLogModel.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/core/database/db_session.py b/app/core/database/db_session.py index 7a1ebcb..48fe9cd 100644 --- a/app/core/database/db_session.py +++ b/app/core/database/db_session.py @@ -266,7 +266,7 @@ def receive_before_flush(session, flush_context, instances): user_id=session.info.get("user_id"), entity_type=entity_type, entity_id=entity_id, - action=action, + action=str(action)[:100], old_value=old_val_dict, new_value=new_val_dict, ip_address=session.info.get("ip_address") or "127.0.0.1", diff --git a/app/models/AuditLogModel.py b/app/models/AuditLogModel.py index e6cae9f..1dee37f 100644 --- a/app/models/AuditLogModel.py +++ b/app/models/AuditLogModel.py @@ -10,7 +10,7 @@ class AuditLog(Base): user_id = Column(String(26), ForeignKey("users.user_id", ondelete="SET NULL"), nullable=True) entity_type = Column(String(50), nullable=False) entity_id = Column(String(50), nullable=False) - action = Column(String(30), nullable=False) + action = Column(String(100), nullable=False) old_value = Column(JSON, nullable=True) new_value = Column(JSON, nullable=True) ip_address = Column(String(45), nullable=False)