ashb commented on a change in pull request #5418: [AIRFLOW-3036] Updates for
MYSQL migrations
URL: https://github.com/apache/airflow/pull/5418#discussion_r293966054
##########
File path:
airflow/migrations/versions/0a2a5b66e19d_add_task_reschedule_table.py
##########
@@ -66,13 +66,14 @@ def upgrade():
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('task_id', sa.String(length=250), nullable=False),
sa.Column('dag_id', sa.String(length=250), nullable=False),
- # use explicit server_default=None otherwise mysql implies defaults
for first timestamp column
- sa.Column('execution_date', timestamp(), nullable=False,
server_default=None),
+ sa.Column('execution_date', timestamp(), nullable=False,
+ server_default=sa.text('CURRENT_TIMESTAMP(6)')),
sa.Column('try_number', sa.Integer(), nullable=False),
- sa.Column('start_date', timestamp(), nullable=False),
- sa.Column('end_date', timestamp(), nullable=False),
+ sa.Column('start_date', timestamp(), nullable=False,
server_default=sa.text('CURRENT_TIMESTAMP(6)')),
+ sa.Column('end_date', timestamp(), nullable=False,
server_default=sa.text('CURRENT_TIMESTAMP(6)')),
Review comment:
Additionally: I am not sure this is the right fix: we don't want the default
value of these columns to be "Now()" or any variation of 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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services