- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for SetupJoinTable (0.07 sec)
-
gorm.go
// Expr returns clause.Expr, which can be used to pass SQL expression as params func Expr(expr string, args ...interface{}) clause.Expr { return clause.Expr{SQL: expr, Vars: args} } // SetupJoinTable setup join table schema func (db *DB) SetupJoinTable(model interface{}, field string, joinTable interface{}) error { var ( tx = db.getInstance() stmt = tx.Statement
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Oct 09 11:29:48 UTC 2024 - 12.1K bytes - Viewed (0) -
tests/associations_test.go
Name string Organizations []Organization `gorm:"many2many:region_orgs;"` } type RegionOrg struct { RegionId uint OrganizationId uint Empty myType } if err := DB.SetupJoinTable(&Region{}, "Organizations", &RegionOrg{}); err != nil { t.Fatalf("Failed to set up join table, got error: %s", err) } if err := DB.Migrator().DropTable(&Organization{}, &Region{}); err != nil {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Feb 08 08:29:09 UTC 2023 - 10.9K bytes - Viewed (0)