Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 15 of 15 for MANY2MANY (0.05 sec)

  1. tests/association_generics_test.go

    	}
    	if rows, err := gorm.G[User](DB).Where("id = ?", user.ID).Set(assocOp).Update(ctx); err != nil {
    		t.Fatalf("Set Update many2many create with set failed: %v", err)
    	} else if rows != 0 {
    		t.Fatalf("expected 0 rows affected, got %d", rows)
    	}
    
    	AssertAssociationCount(t, user, "Languages", 1, "after create language")
    }
    
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Fri Sep 12 05:42:26 UTC 2025
    - 37.9K bytes
    - Viewed (0)
  2. tests/associations_test.go

    	if err != nil {
    		t.Fatalf("Failed to find, got error: %v", err)
    	}
    
    	AssertEqual(t, result, user)
    }
    
    // Ensure Association.Append/Replace supports map for many2many
    func TestAssociationMany2ManyAppendMap(t *testing.T) {
    	user := *GetUser("assoc_m2m_append_map", Config{})
    	if err := DB.Create(&user).Error; err != nil {
    		t.Fatalf("create user: %v", err)
    	}
    
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Fri Sep 12 04:33:27 UTC 2025
    - 13.3K bytes
    - Viewed (0)
  3. generics.go

    				} else {
    					db.AddError(fmt.Errorf("relation %s not found", association))
    					return nil
    				}
    			}
    
    			if q.limitPerRecord > 0 {
    				if relation.JoinTable != nil {
    					tx.AddError(fmt.Errorf("many2many relation %s don't support LimitPerRecord", association))
    					return tx
    				}
    
    				refColumns := []clause.Column{}
    				for _, rel := range relation.References {
    					if rel.OwnPrimaryKey {
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Sun Nov 02 14:09:18 UTC 2025
    - 25.9K bytes
    - Viewed (0)
  4. migrator/migrator.go

    		return &uni, stmt.Table
    	}
    
    	getTable := func(rel *schema.Relationship) string {
    		switch rel.Type {
    		case schema.HasOne, schema.HasMany:
    			return rel.FieldSchema.Table
    		case schema.Many2Many:
    			return rel.JoinTable.Table
    		}
    		return stmt.Table
    	}
    
    	for _, rel := range stmt.Schema.Relationships.Relations {
    		if constraint := rel.ParseConstraint(); constraint != nil && constraint.Name == name {
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Sun Oct 26 12:31:09 UTC 2025
    - 29.7K bytes
    - Viewed (0)
  5. tests/migrate_test.go

    		{"accounts", "fk_users_account"},
    		{"users", "fk_users_team"},
    		{"users", "fk_users_company"},
    	} {
    		if !DB.Migrator().HasConstraint(indexes[0], indexes[1]) {
    			t.Fatalf("Failed to find index for many2many for %v %v", indexes[0], indexes[1])
    		}
    	}
    }
    
    func TestAutoMigrateInt8PGAndGaussDB(t *testing.T) {
    	if DB.Dialector.Name() != "postgres" && DB.Dialector.Name() != "gaussdb" {
    		return
    	}
    
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Wed Aug 20 04:51:17 UTC 2025
    - 65.2K bytes
    - Viewed (0)
Back to top