mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-18 15:29:36 +00:00
fix(dealix): rename EvidencePack.metadata_ to pack_metadata
SQLAlchemy 2.0 reserves 'metadata' as a class-level attribute on DeclarativeBase classes. Using metadata_ Python attribute with column name 'metadata' caused issues during table creation in init_db(), which prevented pytest from collecting tests (exit code 4). Renamed to pack_metadata to avoid all reserved-name conflicts. https://claude.ai/code/session_01W1rJthWDkasijTdXCfxVHs
This commit is contained in:
parent
2421e41e7a
commit
37c99f43ed
@ -37,7 +37,7 @@ class EvidencePack(TenantModel):
|
|||||||
assembled_by_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
|
assembled_by_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
|
||||||
status = Column(Enum(EvidencePackStatus), nullable=False, default=EvidencePackStatus.ASSEMBLING)
|
status = Column(Enum(EvidencePackStatus), nullable=False, default=EvidencePackStatus.ASSEMBLING)
|
||||||
contents = Column(JSONB, default=list) # list of evidence items
|
contents = Column(JSONB, default=list) # list of evidence items
|
||||||
metadata_ = Column("metadata", JSONB, default=dict)
|
pack_metadata = Column(JSONB, default=dict)
|
||||||
reviewed_by_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
|
reviewed_by_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
|
||||||
reviewed_at = Column(DateTime(timezone=True), nullable=True)
|
reviewed_at = Column(DateTime(timezone=True), nullable=True)
|
||||||
hash_signature = Column(String(64), nullable=True) # SHA256 of contents
|
hash_signature = Column(String(64), nullable=True) # SHA256 of contents
|
||||||
|
|||||||
@ -45,7 +45,7 @@ class EvidencePackService:
|
|||||||
assembled_by_id=assembled_by_id,
|
assembled_by_id=assembled_by_id,
|
||||||
status=EvidencePackStatus.READY,
|
status=EvidencePackStatus.READY,
|
||||||
contents=pack_contents,
|
contents=pack_contents,
|
||||||
metadata_=metadata or {},
|
pack_metadata=metadata or {},
|
||||||
hash_signature=hash_sig,
|
hash_signature=hash_sig,
|
||||||
)
|
)
|
||||||
db.add(pack)
|
db.add(pack)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user