Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for AUTOINCREMENT (0.19 sec)

  1. tests/postgres_test.go

    		t.Fatalf("failed to get columns, got error %v", err)
    	}
    
    	hasLogID := false
    	for _, column := range columns {
    		if column.Name() == "log_id" {
    			hasLogID = true
    			autoIncrement, ok := column.AutoIncrement()
    			if !ok || !autoIncrement {
    				t.Fatalf("column log_id should be auto incrementment")
    			}
    		}
    	}
    
    	if !hasLogID {
    		t.Fatalf("failed to found column log_id")
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Oct 08 09:16:32 GMT 2022
    - 6.4K bytes
    - Viewed (3)
  2. migrator/column_type.go

    func (ct ColumnType) PrimaryKey() (isPrimaryKey bool, ok bool) {
    	return ct.PrimaryKeyValue.Bool, ct.PrimaryKeyValue.Valid
    }
    
    // AutoIncrement returns the column is auto increment or not.
    func (ct ColumnType) AutoIncrement() (isAutoIncrement bool, ok bool) {
    	return ct.AutoIncrementValue.Bool, ct.AutoIncrementValue.Valid
    }
    
    // Length returns the column type length for variable length column types
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 24 01:31:58 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  3. migrator.go

    type ColumnType interface {
    	Name() string
    	DatabaseTypeName() string                 // varchar
    	ColumnType() (columnType string, ok bool) // varchar(64)
    	PrimaryKey() (isPrimaryKey bool, ok bool)
    	AutoIncrement() (isAutoIncrement bool, ok bool)
    	Length() (length int64, ok bool)
    	DecimalSize() (precision int64, scale int64, ok bool)
    	Nullable() (nullable bool, ok bool)
    	Unique() (unique bool, ok bool)
    	ScanType() reflect.Type
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  4. schema/schema_helper_test.go

    		}
    
    		if !ok {
    			t.Errorf("schema %v failed to look up field with name %v", s, f.Name)
    		} else {
    			tests.AssertObjEqual(t, parsedField, f, "Name", "DBName", "BindNames", "DataType", "PrimaryKey", "AutoIncrement", "Creatable", "Updatable", "Readable", "HasDefaultValue", "DefaultValue", "NotNull", "Unique", "Comment", "Size", "Precision", "TagSettings")
    
    			if f.DBName != "" {
    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)
  5. schema/schema_test.go

    		Name: "ProductID", DBName: "product_id", BindNames: []string{"ProductID"}, DataType: schema.Uint, PrimaryKey: true, Size: 64, HasDefaultValue: true, AutoIncrement: true, TagSettings: map[string]string{"PRIMARYKEY": "PRIMARYKEY", "AUTOINCREMENT": "AUTOINCREMENT"},
    	}
    
    	product.Fields = []*schema.Field{product.PrioritizedPrimaryField}
    
    	checkSchemaField(t, product, &prioritizedPrimaryField, func(f *schema.Field) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  6. tests/embedded_struct_test.go

    		if DB.Dialector.Name() != "sqlite" {
    			t.Errorf("Failed to auto migrate advanced user, got error %v", err)
    		}
    	}
    }
    
    func TestEmbeddedTagSetting(t *testing.T) {
    	type Tag1 struct {
    		Id int64 `gorm:"autoIncrement"`
    	}
    	type Tag2 struct {
    		Id int64
    	}
    
    	type EmbeddedTag struct {
    		Tag1 Tag1 `gorm:"Embedded;"`
    		Tag2 Tag2 `gorm:"Embedded;EmbeddedPrefix:t2_"`
    		Name string
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Oct 26 03:58:13 GMT 2023
    - 7.3K bytes
    - Viewed (0)
  7. schema/schema.go

    			schema.PrioritizedPrimaryField = schema.PrimaryFields[0]
    		} else if len(schema.PrimaryFields) > 1 {
    			// If there are multiple primary keys, the AUTOINCREMENT field is prioritized
    			for _, field := range schema.PrimaryFields {
    				if field.AutoIncrement {
    					schema.PrioritizedPrimaryField = field
    					break
    				}
    			}
    		}
    	}
    
    	for _, field := range schema.PrimaryFields {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  8. schema/field.go

    		Updatable:              true,
    		Readable:               true,
    		PrimaryKey:             utils.CheckTruth(tagSetting["PRIMARYKEY"], tagSetting["PRIMARY_KEY"]),
    		AutoIncrement:          utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
    		HasDefaultValue:        utils.CheckTruth(tagSetting["AUTOINCREMENT"]),
    		NotNull:                utils.CheckTruth(tagSetting["NOT NULL"], tagSetting["NOTNULL"]),
    		Unique:                 utils.CheckTruth(tagSetting["UNIQUE"]),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  9. tests/migrate_test.go

    		ID  uint `gorm:"primarykey"`
    		UID uint32
    	}
    
    	type Event1 struct {
    		ID  uint   `gorm:"primarykey"`
    		UID uint32 `gorm:"not null;autoIncrement"`
    	}
    
    	type Event2 struct {
    		ID  uint   `gorm:"primarykey"`
    		UID uint16 `gorm:"not null;autoIncrement"`
    	}
    
    	var err error
    	err = DB.Migrator().DropTable(&Event{})
    	if err != nil {
    		t.Errorf("DropTable err:%v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  10. schema/relationship.go

    			Name:    joinFieldName,
    			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
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
Back to top