add log
This commit is contained in:
parent
f09ac71753
commit
c8e7b7f904
@ -63,13 +63,13 @@ func TestPostgres(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Post struct {
|
type Post struct {
|
||||||
ID uuid.UUID `gorm:"primary_key;type:uuid;autoincrement"`
|
ID uuid.UUID `gorm:"primary_key;type:uuid;default:gen_random_uuid();autoincrement"`
|
||||||
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;autoincrement"`
|
ID uuid.UUID `gorm:"primary_key;type:uuid;default:gen_random_uuid();autoincrement"`
|
||||||
Title string
|
Title string
|
||||||
Posts []*Post `gorm:"Many2Many:post_categories"`
|
Posts []*Post `gorm:"Many2Many:post_categories"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user