- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for foreignKeys (0.21 sec)
-
schema/utils.go
} // ToQueryValues to query values func ToQueryValues(table string, foreignKeys []string, foreignValues [][]interface{}) (interface{}, []interface{}) { queryValues := make([]interface{}, len(foreignValues)) if len(foreignKeys) == 1 { for idx, r := range foreignValues { queryValues[idx] = r[0] } return clause.Column{Table: table, Name: foreignKeys[0]}, queryValues }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Sat Aug 19 13:35:14 GMT 2023 - 5.5K bytes - Viewed (0) -
tests/update_has_one_test.go
gorm.Model UserID sql.NullInt64 Number string `gorm:"<-:create"` Number2 string } type CustomizeUser struct { gorm.Model Name string Account CustomizeAccount `gorm:"foreignkey:UserID"` } DB.Migrator().DropTable(&CustomizeUser{}) DB.Migrator().DropTable(&CustomizeAccount{}) if err := DB.AutoMigrate(&CustomizeUser{}); err != nil {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jul 14 06:55:54 GMT 2022 - 3.6K bytes - Viewed (0) -
schema/schema_helper_test.go
for _, rf := range r.References { if (rf.PrimaryKey == nil || (rf.PrimaryKey.Name == ref.PrimaryKey && rf.PrimaryKey.Schema.Name == ref.PrimarySchema)) && (rf.PrimaryValue == ref.PrimaryValue) && (rf.ForeignKey.Name == ref.ForeignKey && rf.ForeignKey.Schema.Name == ref.ForeignSchema) && (rf.OwnPrimaryKey == ref.OwnPrimaryKey) { found = true } } if !found { var refs []string
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:31:23 GMT 2023 - 7.5K bytes - Viewed (0) -
utils/tests/models.go
Toys []Toy `gorm:"polymorphic:Owner"` Tools []Tools `gorm:"polymorphicType:Type;polymorphicId:CustomID"` CompanyID *int Company Company ManagerID *uint Manager *User Team []User `gorm:"foreignkey:ManagerID"` Languages []Language `gorm:"many2many:UserSpeak;"` Friends []*User `gorm:"many2many:user_friends;"` Active bool } type Account struct { gorm.Model UserID sql.NullInt64
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 2.1K bytes - Viewed (0) -
callbacks/delete.go
if ref.OwnPrimaryKey { foreignFields = append(foreignFields, ref.PrimaryKey) relForeignKeys = append(relForeignKeys, ref.ForeignKey.DBName) } else if ref.PrimaryValue != "" { queryConds = append(queryConds, clause.Eq{ Column: clause.Column{Table: rel.JoinTable.Table, Name: ref.ForeignKey.DBName}, Value: ref.PrimaryValue, }) } }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Feb 25 02:48:23 GMT 2022 - 5.6K bytes - Viewed (0) -
schema/model_test.go
Account *tests.Account Pets []*tests.Pet Toys []*tests.Toy `gorm:"polymorphic:Owner"` CompanyID *int Company *tests.Company ManagerID *uint Manager *User Team []*User `gorm:"foreignkey:ManagerID"` Languages []*tests.Language `gorm:"many2many:UserSpeak"` Friends []*User `gorm:"many2many:user_friends"` Active *bool } type ( mytime time.Time myint int mybool = bool
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 1.1K bytes - Viewed (0) -
tests/error_translator_test.go
gorm.Model Name string `gorm:"unique"` } type Museum struct { gorm.Model Name string `gorm:"unique"` CityID uint City City `gorm:"Constraint:OnUpdate:CASCADE,OnDelete:CASCADE;FOREIGNKEY:CityID;References:ID"` } db, err := OpenTestConnection(&gorm.Config{TranslateError: true}) if err != nil { t.Fatalf("failed to connect database, got error %v", err) }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Jul 12 13:21:22 GMT 2023 - 3.1K bytes - Viewed (0)