EnableServices opened a new issue, #40311:
URL: https://github.com/apache/airflow/issues/40311

   ### Apache Airflow version
   
   2.9.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Running `airflow db migrate` after upgrade to version 2.9.2, experienced 
duplicate key errors adding constraints
   
   ### What you think should happen instead?
   
   The script execution should not halt with the following error:
   
   ```
   sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1061, 
"Duplicate key name 'connection_conn_id_uq'")
   [SQL: ALTER TABLE connection ADD CONSTRAINT connection_conn_id_uq UNIQUE 
(conn_id)]
   ```
   
   ### How to reproduce
   
   Install Airflow 2.9.1 using MySQL backend
   Upgrade to Airflow 2.9.2
   Run `airflow db migrate`
   
   ### Operating System
   
   Debian bookworm
   
   ### Versions of Apache Airflow Providers
   
   N/A
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   Within a code block intended for MySQL, the migration script 
https://github.com/apache/airflow/blob/2.9.2/airflow/migrations/versions/0142_2_9_2_fix_inconsistency_between_ORM_and_migration_files.py
 uses the statement
   
   ```
   DROP CONSTRAINT
   ```
   which is not supported on MySQL
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscr...@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to