mirror of https://github.com/go-gorm/gorm.git
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 {
|
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
|
Title string
|
||||||
Categories []*Category `gorm:"Many2Many:post_categories"`
|
Categories []*Category `gorm:"Many2Many:post_categories"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Category struct {
|
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
|
Title string
|
||||||
Posts []*Post `gorm:"Many2Many:post_categories"`
|
Posts []*Post `gorm:"Many2Many:post_categories"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue