Fix broken MySQL Migration (#12904)
We added a change https://github.com/apache/airflow/pull/12890 to fix type of `source_code` column in `dag_code` table. But looks like MySQL does not like if we don't specify nullable field.
This commit is contained in:
Родитель
5f65cec77e
Коммит
cb70150bf6
|
@ -36,10 +36,12 @@ depends_on = None
|
|||
def upgrade(): # noqa: D103
|
||||
conn = op.get_bind() # pylint: disable=no-member
|
||||
if conn.dialect.name == "mysql":
|
||||
op.alter_column(table_name='dag_code', column_name='source_code', type_=mysql.MEDIUMTEXT)
|
||||
op.alter_column(
|
||||
table_name='dag_code', column_name='source_code', type_=mysql.MEDIUMTEXT, nullable=False
|
||||
)
|
||||
|
||||
|
||||
def downgrade(): # noqa: D103
|
||||
conn = op.get_bind() # pylint: disable=no-member
|
||||
if conn.dialect.name == "mysql":
|
||||
op.alter_column(table_name='dag_code', column_name='source_code', type_=mysql.TEXT)
|
||||
op.alter_column(table_name='dag_code', column_name='source_code', type_=mysql.TEXT, nullable=False)
|
||||
|
|
Загрузка…
Ссылка в новой задаче