Skip to content

Commit

Permalink
fixup! Replace TaskInstanceNote composite primary key with TI.id
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimbuddy committed Mar 5, 2025
1 parent 9a9cfc7 commit 7dc6d1b
Show file tree
Hide file tree
Showing 4 changed files with 730 additions and 750 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ def downgrade():
"""Unapply Use TI.id as primary key to TaskInstanceNote."""
dialect_name = op.get_bind().dialect.name
with op.batch_alter_table("task_instance_note", schema=None) as batch_op:
batch_op.add_column(sa.Column("dag_id", sa.String(length=250), nullable=True))
batch_op.add_column(sa.Column("task_id", sa.String(length=250), nullable=True))
batch_op.add_column(sa.Column("run_id", sa.String(length=250), nullable=True))
batch_op.add_column(sa.Column("dag_id", StringID(), nullable=True))
batch_op.add_column(sa.Column("task_id", StringID(), nullable=True))
batch_op.add_column(sa.Column("run_id", StringID(), nullable=True))
batch_op.add_column(sa.Column("map_index", sa.Integer(), nullable=True, server_default=sa.text("-1")))

if dialect_name == "postgresql":
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/taskinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3799,7 +3799,7 @@ def from_ti(cls, ti: TaskInstance) -> SimpleTaskInstance:
)


class TaskInstanceNote(TaskInstanceDependencies):
class TaskInstanceNote(Base):
"""For storage of arbitrary notes concerning the task instance."""

__tablename__ = "task_instance_note"
Expand Down
2 changes: 1 addition & 1 deletion docs/apache-airflow/img/airflow_erd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
40e964181b3f9bcfa8290e193fd99b0997b668b94e5dcb5f5e3b892938214b4a
4d62c1ca8392bf8b0b25ca5076373e9ee7019f1d11fab7d3081389a588eb5e86
Loading

0 comments on commit 7dc6d1b

Please sign in to comment.