dstandish commented on code in PR #27867:
URL: https://github.com/apache/airflow/pull/27867#discussion_r1031235863
##########
airflow/models/dagrun.py:
##########
@@ -1295,3 +1307,41 @@ def get_log_filename_template(self, *, session: Session
= NEW_SESSION) -> str:
stacklevel=2,
)
return self.get_log_template(session=session).filename
+
+
+class DagRunNote(Base):
+ """For storage of arbitrary notes concerning the dagrun instance."""
+
+ __tablename__ = "dag_run_note"
+
+ user_id = Column(Integer, nullable=True)
+ dag_run_id = Column(Integer, primary_key=True, nullable=False)
+ content = Column(String(1000).with_variant(Text(1000), "mysql"))
+ created_at = Column(UtcDateTime, default=timezone.utcnow, nullable=False)
+ updated_at = Column(UtcDateTime, default=timezone.utcnow,
onupdate=timezone.utcnow, nullable=False)
+
+ dag_run = relationship("DagRun", back_populates="dag_run_note")
+
+ __table_args__ = (
+ ForeignKeyConstraint(
+ (dag_run_id,),
+ ["dag_run.id"],
+ name="dag_run_note_dr_fkey",
+ ondelete="CASCADE",
+ ),
+ ForeignKeyConstraint(
+ (user_id,),
+ ["ab_user.id"],
+ name="dag_run_note_user_fkey",
+ ),
+ )
+
+ def __init__(self, content, user_id=None):
Review Comment:
Required for creator
--
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]