I prefer the non-unique index names to have an __idx suffix (avoids some probably non-existant namespace issues).
The ON DELETE CASCADE is an issue. If someone attempts to delete a Branch that has a running job, I suspect we actually want to generate an error (or will things somehow progress just fine despite the branch disappearing part of the way through the process?). There is quite a bit of logic in branch deletion on when branches can be deleted, and the DB constraints serve as a safety net for that. The ON DELETE CASCADE on the job column seems sane.
The DB patch is already using an assigned patch number, so nothing to change there.
Mainly fine.
I prefer the non-unique index names to have an __idx suffix (avoids some probably non-existant namespace issues).
The ON DELETE CASCADE is an issue. If someone attempts to delete a Branch that has a running job, I suspect we actually want to generate an error (or will things somehow progress just fine despite the branch disappearing part of the way through the process?). There is quite a bit of logic in branch deletion on when branches can be deleted, and the DB constraints serve as a safety net for that. The ON DELETE CASCADE on the job column seems sane.
The DB patch is already using an assigned patch number, so nothing to change there.