fat-catTW commented on code in PR #71214:
URL: https://github.com/apache/airflow/pull/71214#discussion_r4337071072


##########
airflow-core/src/airflow/models/callback.py:
##########
@@ -143,10 +143,17 @@ class Callback(Base, BaseWorkload):
     # Creation time of the callback
     created_at: Mapped[datetime] = mapped_column(UtcDateTime, 
default=timezone.utcnow, nullable=False)
 
+    dagrun_id: Mapped[int | None] = mapped_column(
+        Integer, ForeignKey("dag_run.id", ondelete="CASCADE"), nullable=True

Review Comment:
   Thanks, good point. 
   I added callback to dag_run's dependent tables so db clean -t dag_run 
archives callbacks before deleting the DagRun. I also added an integration test 
that creates an executor callback linked to a DagRun and verifies that it is 
archived.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to