- Sort Score
- Result 10 results
- Languages All
Results 1 - 4 of 4 for DecimalSize (0.31 sec)
-
migrator/column_type.go
return ct.LengthValue.Int64, true } return ct.SQLColumnType.Length() } // DecimalSize returns the scale and precision of a decimal type. func (ct ColumnType) DecimalSize() (precision int64, scale int64, ok bool) { if ct.DecimalSizeValue.Valid { return ct.DecimalSizeValue.Int64, ct.ScaleValue.Int64, true } return ct.SQLColumnType.DecimalSize() } // Nullable reports whether the column may be null.
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Mar 24 01:31:58 UTC 2022 - 3.3K bytes - Viewed (0) -
migrator.go
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 Comment() (value string, ok bool) DefaultValue() (value string, ok bool) }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 3.1K bytes - Viewed (0) -
tests/migrate_test.go
} case "salary": if precision, o, _ := columnType.DecimalSize(); (fullSupported || precision != 0) && precision != 2 { t.Fatalf("salary's precision should be 2, but got %v %v", precision, o) } case "birthday": if precision, _, _ := columnType.DecimalSize(); (fullSupported || precision != 0) && precision != 2 {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Aug 20 04:51:17 UTC 2025 - 65.2K bytes - Viewed (0) -
migrator/migrator.go
precision, scale, ok := columnType.DecimalSize() if ok { if !strings.HasPrefix(fullDataType, fmt.Sprintf("%s(%d,%d)", realDataType, precision, scale)) && !strings.HasPrefix(fullDataType, fmt.Sprintf("%s(%d)", realDataType, precision)) { alterColumn = true } } } else { if precision, _, ok := columnType.DecimalSize(); ok && int64(field.Precision) != precision {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Fri Jun 06 02:35:01 UTC 2025 - 29.5K bytes - Viewed (0)