registry
registry copied to clipboard
Registry server: Declarative database associations
Manually maintaining DB integrity can be quite error prone and should generally be done via rules. For example, the current model doesn't use foreign key constraints and we have to manually code relationship integrity during deletion (eg. for wipeout. We should transition to declarative association modeling as much as possible.
GORM can automatically create and maintain the common associations:
It's unclear to me why there is a cascade option in storage/delete.go. Would cascade=false
not leave the database in an inconsistent state?
Sorry, I misread the intent: The cascade
option is the same as the force
field in AIP-135 - ie. If cascade
is true, force delete the object and all its children. If cascade
is false, fail if there are any children.