From d23d5bdbadc116059e5f013b989cf4a44accb138 Mon Sep 17 00:00:00 2001 From: Michelle Tran Date: Tue, 22 Oct 2024 15:31:33 -0400 Subject: [PATCH] Fix ReducedError to make it more similar to Django Model In particular, this table doesn't actually have an external id. --- database/models/reports.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/database/models/reports.py b/database/models/reports.py index d32188733..08ae895f8 100644 --- a/database/models/reports.py +++ b/database/models/reports.py @@ -334,9 +334,18 @@ class TestResultReportTotals(CodecovBaseModel, MixinBaseClass): error = Column(types.String(100), nullable=True) -class ReducedError(CodecovBaseModel, MixinBaseClass): +class ReducedError(CodecovBaseModel): __tablename__ = "reports_reducederror" + id_ = Column("id", types.BigInteger, primary_key=True) message = Column(types.Text) + created_at = Column(types.DateTime(timezone=True), default=get_utc_now) + updated_at = Column( + types.DateTime(timezone=True), onupdate=get_utc_now, default=get_utc_now + ) + + @property + def id(self): + return self.id_ class Flake(CodecovBaseModel, MixinBaseClassNoExternalID):