-
Type:
Bug
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.10.4
-
Fix Version/s: None
-
Component/s: database
-
Labels:None
When I run `airflow upgrade` when upgrading from 1.10.1 to 1.10.4, this is the error that I get:
```
sqlalchemy.exc.IntegrityError: (_mysql_exceptions.IntegrityError) (1215, 'Cannot add foreign key constraint')sqlalchemy.exc.IntegrityError: (_mysql_exceptions.IntegrityError) (1215, 'Cannot add foreign key constraint')[SQL: CREATE TABLE task_reschedule ( id INTEGER NOT NULL AUTO_INCREMENT, task_id VARCHAR(250) NOT NULL, dag_id VARCHAR(250) NOT NULL, execution_date TIMESTAMP(6) NOT NULL, try_number INTEGER NOT NULL, start_date TIMESTAMP(6) NOT NULL, end_date TIMESTAMP(6) NOT NULL, duration INTEGER NOT NULL, reschedule_date TIMESTAMP(6) NOT NULL, PRIMARY KEY (id), CONSTRAINT task_reschedule_dag_task_date_fkey FOREIGN KEY(task_id, dag_id, execution_date) REFERENCES task_instance (task_id, dag_id, execution_date))
```
Database: Managed Mysql on Azure
Airflow webserver, scheduler and worker are containerized using an Ubuntu docker image.
To upgrade, I stopped the containers, then started one container with `bash` as the foreground process.
```
pip install apache-airflow==1.10.4
airflow upgradedb
```