fix: remove uuid autoincrement (#5620)

This commit is contained in:
Cr 2022-09-03 20:00:21 +08:00 committed by GitHub
parent 8c3018b96a
commit d71caef7d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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"`
}