Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 13 of 13 for company_id (0.14 sec)

  1. schema/model_test.go

    )
    
    type User struct {
    	*gorm.Model
    	Name      *string
    	Age       *uint
    	Birthday  *time.Time
    	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"`
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 1.1K bytes
    - Viewed (0)
  2. tests/migrate_test.go

    		}
    
    		if !m.HasTable(tableName) {
    			t.Fatalf("AutoMigrate expected %#v exist, but not.", tableName)
    		}
    
    		if !m.HasIndex(&DynamicUser{}, "CompanyID") {
    			t.Fatalf("Should have index on %s", "CompanyI.")
    		}
    
    		if !m.HasIndex(&DynamicUser{}, "DeletedAt") {
    			t.Fatalf("Should have index on deleted_at.")
    		}
    	}
    }
    
    // check column order after migration, flaky test
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Mar 18 11:24:16 UTC 2024
    - 56.2K bytes
    - Viewed (0)
  3. schema/relationship_test.go

    		},
    	})
    
    	checkStructRelation(t, &result, Relation{
    		Name: "Company", Type: schema.BelongsTo, Schema: "", FieldSchema: "Company",
    		References: []Reference{
    			{"ID", "Company", "CompanyID", "", "", false},
    		},
    	})
    }
    
    func TestSameForeignKey(t *testing.T) {
    	type UserAux struct {
    		gorm.Model
    		Aux  string
    		UUID string
    	}
    
    	type User struct {
    		gorm.Model
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 25.5K bytes
    - Viewed (0)
Back to top