luoyuliuyin opened a new issue #20458: URL: https://github.com/apache/airflow/issues/20458
### Apache Airflow version 2.2.3 (latest released) ### What happened **the API of delete_dag does not delete the record in dag_code.**  This function will delete all the records containing the dag_id field, and will delete the related records of TaskFail, TaskInstance, ImportError. But the dag_code table does not have a dag_id field, the records in it will not be deleted. `function location: airflow.api_connexion.endpoints.dag_endpoint.delete_dag()`  show create table of dag_code  ### What you expected to happen All related records in the database are deleted, including the dag_code table. ### How to reproduce _No response_ ### Operating System MacOS 12.1 ### Versions of Apache Airflow Providers 2.2.2 ### Deployment Virtualenv installation ### Deployment details _No response_ ### Anything else _No response_ ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
