ephraimbuddy commented on code in PR #27849:
URL: https://github.com/apache/airflow/pull/27849#discussion_r1031115847
##########
airflow/models/taskinstance.py:
##########
@@ -2676,6 +2684,52 @@ def from_dict(cls, obj_dict: dict) -> SimpleTaskInstance:
return cls(**obj_dict, start_date=start_date, end_date=end_date,
key=ti_key)
+class TaskInstanceNote(Base):
+ """For storage of arbitrary notes concerning the task instance."""
+
+ __tablename__ = "task_instance_note"
+
+ user_id = Column(Integer, nullable=True)
+ task_id = Column(StringID(), primary_key=True, nullable=False)
+ dag_id = Column(StringID(), primary_key=True, nullable=False)
+ run_id = Column(StringID(), primary_key=True, nullable=False)
+ map_index = 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)
+
+ task_instance = relationship("TaskInstance",
back_populates="task_instance_note")
+
+ __table_args__ = (
+ ForeignKeyConstraint(
Review Comment:
We need to add explicit PrimaryKeyConstraint with a name here otherwise it
will be different from what's on the migration file and will give issues for
ORM created db if we want to migrate it
--
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]