kaxil commented on code in PR #44221:
URL: https://github.com/apache/airflow/pull/44221#discussion_r1855523579
##########
airflow/migrations/versions/0032_3_0_0_drop_execution_date_unique.py:
##########
@@ -44,14 +45,24 @@
def upgrade():
with op.batch_alter_table("dag_run", schema=None) as batch_op:
- batch_op.alter_column("execution_date",
new_column_name="logical_date", existing_type=sa.TIMESTAMP)
+ batch_op.alter_column(
+ "execution_date",
+ new_column_name="logical_date",
+ existing_type=UtcDateTime,
Review Comment:
Those are the same. Both use `TIMESTAMP`
https://github.com/apache/airflow/blob/5b2a96ee72a4bd7b7fbd4925c2f8c8468f047a64/airflow/utils/sqlalchemy.py#L48-L62
https://github.com/apache/airflow/blob/5b2a96ee72a4bd7b7fbd4925c2f8c8468f047a64/airflow/migrations/db_types.py#L43-L68
The difference IMO lies in `UtcDateTime` is mainly used in the
Application/ORM layer while `db_types.TIMESTAMP` should be used for alembic
migration.
##########
airflow/migrations/versions/0032_3_0_0_drop_execution_date_unique.py:
##########
@@ -44,14 +45,24 @@
def upgrade():
with op.batch_alter_table("dag_run", schema=None) as batch_op:
- batch_op.alter_column("execution_date",
new_column_name="logical_date", existing_type=sa.TIMESTAMP)
+ batch_op.alter_column(
+ "execution_date",
+ new_column_name="logical_date",
+ existing_type=UtcDateTime,
Review Comment:
Those are the same. Both use `sa.TIMESTAMP`
https://github.com/apache/airflow/blob/5b2a96ee72a4bd7b7fbd4925c2f8c8468f047a64/airflow/utils/sqlalchemy.py#L48-L62
https://github.com/apache/airflow/blob/5b2a96ee72a4bd7b7fbd4925c2f8c8468f047a64/airflow/migrations/db_types.py#L43-L68
The difference IMO lies in `UtcDateTime` is mainly used in the
Application/ORM layer while `db_types.TIMESTAMP` should be used for alembic
migration.
--
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]