Plant catalog backend: CRUD + seeded built-ins (#12)
Build image / build-and-push (push) Successful in 5s
Build image / build-and-push (push) Successful in 5s
Co-authored-by: Steve Dudenhoeffer <[email protected]>
This commit was merged in pull request #31.
This commit is contained in:
@@ -177,3 +177,10 @@ func boolToInt(b bool) int {
|
||||
func isUniqueViolation(err error) bool {
|
||||
return err != nil && strings.Contains(err.Error(), "UNIQUE constraint failed")
|
||||
}
|
||||
|
||||
// isForeignKeyViolation reports whether err is a SQLite FOREIGN KEY-constraint
|
||||
// failure — e.g. deleting a plant a planting still references (ON DELETE
|
||||
// RESTRICT). Same stable-message approach as isUniqueViolation.
|
||||
func isForeignKeyViolation(err error) bool {
|
||||
return err != nil && strings.Contains(err.Error(), "FOREIGN KEY constraint failed")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user