Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.

"""
Make logical_date nullable.
Rename execution_date to logical_date.

The column has been renamed to logical_date, although the Python model is
not changed. This allows us to not need to fix all the Python code at once, but
Expand Down Expand Up @@ -59,6 +59,14 @@ def upgrade():
columns=["dag_id", "logical_date"],
)

with op.batch_alter_table("log", schema=None) as batch_op:
batch_op.alter_column(
"execution_date",
new_column_name="logical_date",
existing_type=TIMESTAMP(timezone=True),
nullable=True,
)


def downgrade():
with op.batch_alter_table("dag_run", schema=None) as batch_op:
Expand All @@ -75,3 +83,11 @@ def downgrade():
"dag_run_dag_id_execution_date_key",
columns=["dag_id", "execution_date"],
)

with op.batch_alter_table("log", schema=None) as batch_op:
batch_op.alter_column(
"logical_date",
new_column_name="execution_date",
existing_type=TIMESTAMP(timezone=True),
nullable=True,
)
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 @@
76818a684a0e05c1fd3ecee6c74b204c9a8d59b22966c62ba08089312fbd6ff4
7e021ff790ebad2c9d56beb9efdf398738a2ea3c904c694b99cf225b28101cbd
Loading
Loading