pg icon indicating copy to clipboard operation
pg copied to clipboard

Cannot parse multiple unique constraints within a single table correctly

Open 8fdafs2 opened this issue 4 years ago • 0 comments

In the beblow case, the two unique constraints might not be constructed correctly in SQL.

type Test struct {
	tableName struct{} `pg:"tests"`

	ID int

	KeyAID int `pg:",unique:g1"`
	KeyBID int `pg:",unique:g1,unique:g2"`
	KeyCID int `pg:",unique:g2"`
}

8fdafs2 avatar Apr 16 '20 10:04 8fdafs2