Skip to content

Audit cascade rules between tables to simplify repo deletion #581

Open

Description

@MoralCode

currently the best way to handle "i want to remove this repo from the database" is a script/command in collectoss-utilities.

When we have the schema a little more cleaned up, I think its not unreasonable to expect CollectOSS to be responsible for its own schema.

IMO CollectOSS should properly set on-delete rules for things joined to the repo table to ensure that, if someone deletes a repo from the repo table, everything that depends on it is also deleted.

the ordering of the existing script should give lots of clues as to what should be deleted.

Activity

  1. added
    database
    tech debt
    on Nov 20, 2026
  2. Shreyanshsingh23 commented on Nov 23, 2026

    @Shreyanshsingh23

    hey @MoralCode, i'd like to pick this up.

    plan is to go through the tables the old delete script touches, check which foreign keys already cascade, and add ON DELETE CASCADE to the missing ones in a migration.

    then i'll test it by deleting a repo and checking nothing's left behind. does that sound ok before i start?

  3. added
    needs-plan
    on Nov 23, 2026
  4. added this to the v1.2 milestone on Nov 23, 2026
  5. MoralCode commented on Nov 23, 2026

    @MoralCode
    ContributorAuthor

    As far as how, that seems okay. However, I will note that doing this at the current moment will make things harder as we have several database PRs already in flight, such as #575. If this is your first time, I'd recommend picking an issue from one of the sources mentioned in #553 (or otherwise finding something that isnt a database issue until the current in-flight backlog of database migrations has been merged.

    Feel free to join CHAOSS Slack in the #wg-collectoss-8knot channel if you'd like help finding something to work on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    databaseneeds-plantech debt

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions