From 4769971b56c2cab3059234a169d955dc7e59ac22 Mon Sep 17 00:00:00 2001 From: GogaCoder Date: Wed, 1 Jan 2025 17:19:43 +0700 Subject: [PATCH] testing: was added test data without pointer type --- tests/testdata/src/relations_check/negative.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/testdata/src/relations_check/negative.go b/tests/testdata/src/relations_check/negative.go index 08665d6..9b0c0b9 100644 --- a/tests/testdata/src/relations_check/negative.go +++ b/tests/testdata/src/relations_check/negative.go @@ -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;"` +}