fix(audit): widen action column to VARCHAR(100) to support order_status_ready_for_delivery

This commit is contained in:
iFixKart Dev 2026-11-18 18:00:20 +05:30
parent 677a0ef8ba
commit bd1678cfe8
2 changed files with 2 additions and 2 deletions

View file

@ -266,7 +266,7 @@ def receive_before_flush(session, flush_context, instances):
user_id=session.info.get("user_id"), user_id=session.info.get("user_id"),
entity_type=entity_type, entity_type=entity_type,
entity_id=entity_id, entity_id=entity_id,
action=action, action=str(action)[:100],
old_value=old_val_dict, old_value=old_val_dict,
new_value=new_val_dict, new_value=new_val_dict,
ip_address=session.info.get("ip_address") or "127.0.0.1", ip_address=session.info.get("ip_address") or "127.0.0.1",

View file

@ -10,7 +10,7 @@ class AuditLog(Base):
user_id = Column(String(26), ForeignKey("users.user_id", ondelete="SET NULL"), nullable=True) user_id = Column(String(26), ForeignKey("users.user_id", ondelete="SET NULL"), nullable=True)
entity_type = Column(String(50), nullable=False) entity_type = Column(String(50), nullable=False)
entity_id = 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) old_value = Column(JSON, nullable=True)
new_value = Column(JSON, nullable=True) new_value = Column(JSON, nullable=True)
ip_address = Column(String(45), nullable=False) ip_address = Column(String(45), nullable=False)