The GitHub Actions job "Tests" on airflow.git has failed.
Run started by GitHub user ephraimbuddy (triggered by ephraimbuddy).

Head commit for run:
3fde1cccd31a474a8a31947107a66f5400b74a9f / Ephraim Anierobi 
<[email protected]>
Add cascade to `dag_tag` to `dag` foreignkey

Bulk delete does not work if the cascade behaviour of a foreignkey
is set on python side(relationship configuration). To allow bulk delete of dags
we need to setup cascade deletion in the DB.

The warning on query.delete at
https://docs.sqlalchemy.org/en/14/orm/session_basics.html#selecting-a-synchronization-strategy
stated that:

The operations do not offer in-Python cascading of relationships - it is 
assumed that ON UPDATE CASCADE and/or ON DELETE CASCADE is configured for any 
foreign key references which require it, otherwise the database may emit an 
integrity violation if foreign key references are being enforced.

Another alternative is avoiding bulk delete of dags but I prefer we support 
bulk deletes.

This will break offline sql generation for mssql(already broken before now :) 
). Also, since there's only one foreign key
in `dag_tag` table, I assume that the foreign key would be named 
`dag_tag_ibfk_1` in `mysql`. This
avoided having to query the db for the name.

The foreignkey is explicitly named now, would be easy for future upgrades

Report URL: https://github.com/apache/airflow/actions/runs/2264763744

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to