testing: was added test data without pointer type
This commit is contained in:
12
tests/testdata/src/relations_check/negative.go
vendored
12
tests/testdata/src/relations_check/negative.go
vendored
@@ -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;"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user