testing: was added test data without pointer type

This commit is contained in:
2025-01-01 17:19:43 +07:00
parent a6574924fe
commit 4769971b56

View File

@@ -1,5 +1,7 @@
package relations_check
// Many-to-many
type Library struct {
Id uint `gorm:"primaryKey"`
Books []*Book `gorm:"many2many:library_book;"`
@@ -14,3 +16,13 @@ type Employee struct {
Id uint `gorm:"primaryKey"`
Subordinates []*Employee `gorm:"many2many:employee_subordinates;"` // self-reference
}
type Publisher struct {
Id uint `gorm:"primaryKey"`
Writers []*Writer `gorm:"many2many:publisher_books;"`
}
type Writer struct {
Id uint `gorm:"primaryKey"`
Publishers []Publisher `gorm:"many2many:publisher_books;"`
}