Skip to content

Commit

Permalink
Schema: name all constraints, not just PKs
Browse files Browse the repository at this point in the history
  • Loading branch information
Al2Klimov committed Jul 12, 2024
1 parent 860ea0c commit 96561ec
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 81 deletions.
6 changes: 3 additions & 3 deletions internal/incident/db_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ func (c *ContactRow) Upsert() interface{} {
// PgsqlOnConflictConstraint implements the database.PgsqlOnConflictConstrainter interface.
func (c *ContactRow) PgsqlOnConflictConstraint() string {
if c.ContactID.Valid {
return "key_incident_contact_contact"
return "uk_incident_contact_incident_id_contact_id"
}

if c.GroupID.Valid {
return "key_incident_contact_contactgroup"
return "uk_incident_contact_incident_id_contactgroup_id"
}

return "key_incident_contact_schedule"
return "uk_incident_contact_incident_id_schedule_id"
}

// RuleRow represents a single incident rule database entry.
Expand Down
Loading

0 comments on commit 96561ec

Please sign in to comment.