diff --git a/database/models/reports.py b/database/models/reports.py index b3a96a28a..96b594b51 100644 --- a/database/models/reports.py +++ b/database/models/reports.py @@ -383,15 +383,14 @@ class DailyTestRollup(CodecovBaseModel, MixinBaseClassNoExternalID): ) -class TestFlagBridge(CodecovBaseModel, MixinBaseClassNoExternalID): +class TestFlagBridge(CodecovBaseModel): __tablename__ = "reports_test_results_flag_bridge" + id_ = Column("id", types.BigInteger, primary_key=True) + test_id = Column(types.Text, ForeignKey("reports_test.id")) test = relationship(Test, backref=backref("test_flag_bridges")) - repoid = Column(types.Integer, ForeignKey("repos.repoid")) - repository = relationship("Repository", backref=backref("test_flag_bridges")) - flag_id = Column( "flag_id", types.BigInteger, ForeignKey("reports_repositoryflag.id") ) diff --git a/tasks/test_results_processor.py b/tasks/test_results_processor.py index 6eff167a2..b1d5e755b 100644 --- a/tasks/test_results_processor.py +++ b/tasks/test_results_processor.py @@ -184,8 +184,7 @@ def _bulk_write_tests_to_db( if test_id not in existing_tests: test_flag_bridge_data += [ - {"test_id": test_id, "repoid": repoid, "flag_id": repo_flags[flag]} - for flag in flags + {"test_id": test_id, "flag_id": repo_flags[flag]} for flag in flags ] test_instance_data.append( diff --git a/tasks/tests/unit/test_test_results_processor_task.py b/tasks/tests/unit/test_test_results_processor_task.py index 57990f048..20aedd051 100644 --- a/tasks/tests/unit/test_test_results_processor_task.py +++ b/tasks/tests/unit/test_test_results_processor_task.py @@ -631,7 +631,6 @@ def test_upload_processor_task_call_existing_test_diff_flags_hash( ] for bridge in test_flag_bridges: assert bridge.flag == repo_flag - assert bridge.repoid == repoid assert len(tests) == 5 assert len(test_instances) == 4