#3982 Replace explicit deletiong with CASCADE
Closed: Dropped by tkopecek. Opened by tkopecek.

I'm hesistating if we want to alter schema to have ON CASCADE DELETE for some of the relationships to not create issues like #3978. OTOH, I'm satisfied with explicitly mentioning such relationships in delete parts, so we know that we're not deleting something which should have history forever. Maybe a compromise could be to find those relationship which are fine to delete or which have no sense without parent record.


I consider this to be dangerous. It's like an rm -rf that follows symlinks. "Explicit is better than implicit"

Metadata Update from @mikem:
- Custom field Size adjusted to None

agreed

Metadata Update from @tkopecek:
- Issue close_status updated to: Dropped
- Issue status updated to: Closed (was: Open)

There is currently one single place we use a cascade in the schema. It was added for draft builds.

In the rpminfo table we have

    FOREIGN KEY (build_id, draft) REFERENCES build (id, draft) ON UPDATE CASCADE,
    --      ^ ensures the draft field is consistent with the build entry

I balked at this a bit in review, but this is a special case and a legitimately tricky one. Without the cascade here the constraint creates a chicken-and-egg problem for updating.

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/3982

Please continue any further discussion there.

Metadata