Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for uniqueIndex (0.18 sec)

  1. schema/index_test.go

    		FieldC string `gorm:"index:,unique"`     // uniqueIndex
    		FieldD string `gorm:"uniqueIndex;index"` // uniqueIndex and index
    
    		FieldE1 string `gorm:"uniqueIndex:uniq_field_e1_e2"` // mul uniqueIndex
    		FieldE2 string `gorm:"uniqueIndex:uniq_field_e1_e2"`
    
    		FieldF1 string `gorm:"uniqueIndex:uniq_field_f1_f2;index"` // mul uniqueIndex and index
    		FieldF2 string `gorm:"uniqueIndex:uniq_field_f1_f2;"`
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 8K bytes
    - Viewed (0)
  2. tests/migrate_test.go

    		}
    		if field.UniqueIndex != uniqueIndex {
    			t.Fatalf("%v: %q column %q uniqueIndex should be %v but got %v", utils.FileWithLineNum(), stmt.Schema, fieldName, uniqueIndex, field.UniqueIndex)
    		}
    	}
    
    	type ( // not unique
    		UniqueStruct1 struct {
    			Name string `gorm:"size:10"`
    		}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  3. schema/index.go

    // ParseIndexes parse schema indexes
    func (schema *Schema) ParseIndexes() map[string]Index {
    	indexes := map[string]Index{}
    
    	for _, field := range schema.Fields {
    		if field.TagSettings["INDEX"] != "" || field.TagSettings["UNIQUEINDEX"] != "" {
    			fieldIndexes, err := parseFieldIndexes(field)
    			if err != nil {
    				schema.err = err
    				break
    			}
    			for _, index := range fieldIndexes {
    				idx := indexes[index.Name]
    				idx.Name = index.Name
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 3.7K bytes
    - Viewed (0)
  4. android/guava-tests/benchmark/com/google/common/collect/MapsMemoryBenchmark.java

     * limitations under the License.
     */
    
    package com.google.common.collect;
    
    import static com.google.common.base.Functions.toStringFunction;
    import static com.google.common.collect.Maps.uniqueIndex;
    
    import com.google.caliper.BeforeExperiment;
    import com.google.caliper.Benchmark;
    import com.google.caliper.Param;
    import com.google.caliper.api.Footprint;
    import com.google.common.collect.BenchmarkHelpers.BiMapImpl;
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Dec 20 15:07:46 GMT 2019
    - 3.4K bytes
    - Viewed (0)
  5. schema/constraint_test.go

    				)
    			}
    		}
    	}
    }
    
    func TestParseUniqueConstraints(t *testing.T) {
    	type UserUnique struct {
    		Name1 string `gorm:"unique"`
    		Name2 string `gorm:"uniqueIndex"`
    	}
    
    	user, err := schema.Parse(&UserUnique{}, &sync.Map{}, schema.NamingStrategy{})
    	if err != nil {
    		t.Fatalf("failed to parse user unique, got error %v", err)
    	}
    	constraints := user.ParseUniqueConstraints()
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sun Feb 04 07:49:19 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  6. tests/associations_test.go

    type AssociationEmptyUser struct {
    	ID   uint
    	Name string
    	Pets []AssociationEmptyPet
    }
    
    type AssociationEmptyPet struct {
    	AssociationEmptyUserID *uint  `gorm:"uniqueIndex:uniq_user_id_name"`
    	Name                   string `gorm:"uniqueIndex:uniq_user_id_name;size:256"`
    }
    
    func TestAssociationEmptyPrimaryKey(t *testing.T) {
    	if DB.Dialector.Name() != "mysql" {
    		t.Skip()
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/collect/FluentIterableTest.java

      public void testUniqueIndex_nullKey() {
        try {
          fluent(1, 2, 3).uniqueIndex(Functions.constant(null));
          fail();
        } catch (NullPointerException expected) {
        }
      }
    
      public void testUniqueIndex_nullValue() {
        try {
          ImmutableMap<Object, Integer> unused =
              fluent(1, null, 2)
                  .uniqueIndex(
                      new Function<Integer, Object>() {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 06 18:35:19 GMT 2024
    - 31.1K bytes
    - Viewed (0)
  8. schema/field.go

    	// In some db (e.g. MySQL), Unique and UniqueIndex are indistinguishable.
    	// When a column has a (not Mul) UniqueIndex, Migrator always reports its gorm.ColumnType is Unique.
    	// It causes field unnecessarily migration.
    	// Therefore, we need to record the UniqueIndex on this column (exclude Mul UniqueIndex) for MigrateColumnUnique.
    	UniqueIndex string
    }
    
    func (field *Field) BindName() string {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  9. android/guava-tests/test/com/google/common/collect/FluentIterableTest.java

      public void testUniqueIndex_nullKey() {
        try {
          fluent(1, 2, 3).uniqueIndex(Functions.constant(null));
          fail();
        } catch (NullPointerException expected) {
        }
      }
    
      public void testUniqueIndex_nullValue() {
        try {
          ImmutableMap<Object, Integer> unused =
              fluent(1, null, 2)
                  .uniqueIndex(
                      new Function<Integer, Object>() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Jun 06 17:32:08 GMT 2023
    - 30.6K bytes
    - Viewed (0)
  10. schema/relationship.go

    			PkgPath: ownField.StructField.PkgPath,
    			Type:    ownField.StructField.Type,
    			Tag: removeSettingFromTag(appendSettingFromTag(ownField.StructField.Tag, "primaryKey"),
    				"column", "autoincrement", "index", "unique", "uniqueindex"),
    		})
    	}
    
    	for idx, relField := range refForeignFields {
    		joinFieldName := strings.Title(relation.FieldSchema.Name) + relField.Name
    
    		if _, ok := ownFieldsMap[joinFieldName]; ok {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
Back to top