forked from mirror/gorm
fix: remove uuid autoincrement (#5620)
This commit is contained in:
parent
8c3018b96a
commit
d71caef7d9
|
@ -63,13 +63,13 @@ func TestPostgres(t *testing.T) {
|
|||
}
|
||||
|
||||
type Post struct {
|
||||
ID uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4();autoincrement"`
|
||||
ID uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4();"`
|
||||
Title string
|
||||
Categories []*Category `gorm:"Many2Many:post_categories"`
|
||||
}
|
||||
|
||||
type Category struct {
|
||||
ID uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4();autoincrement"`
|
||||
ID uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4();"`
|
||||
Title string
|
||||
Posts []*Post `gorm:"Many2Many:post_categories"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue