Skip to content

Commit 37fb724

Browse files
Al2Klimovjulianbrost
authored andcommitted
Schema: name all constraints, not just PKs
1 parent e7a773c commit 37fb724

File tree

3 files changed

+188
-81
lines changed

3 files changed

+188
-81
lines changed

internal/incident/db_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ func (c *ContactRow) Upsert() interface{} {
4343
// PgsqlOnConflictConstraint implements the database.PgsqlOnConflictConstrainter interface.
4444
func (c *ContactRow) PgsqlOnConflictConstraint() string {
4545
if c.ContactID.Valid {
46-
return "key_incident_contact_contact"
46+
return "uk_incident_contact_incident_id_contact_id"
4747
}
4848

4949
if c.GroupID.Valid {
50-
return "key_incident_contact_contactgroup"
50+
return "uk_incident_contact_incident_id_contactgroup_id"
5151
}
5252

53-
return "key_incident_contact_schedule"
53+
return "uk_incident_contact_incident_id_schedule_id"
5454
}
5555

5656
// RuleRow represents a single incident rule database entry.

0 commit comments

Comments
 (0)