mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
dialect/sql/schema: accept convert from string2enum and enum2stirng (#587)
This commit is contained in:
@@ -171,6 +171,9 @@ func (c *Column) ConvertibleTo(d *Column) bool {
|
||||
case c.UintType() && d.IntType():
|
||||
// uintX can not be converted to intY, when X > Y.
|
||||
return c.Type-field.TypeUint8 <= d.Type-field.TypeInt8
|
||||
case c.Type == field.TypeString && d.Type == field.TypeEnum ||
|
||||
c.Type == field.TypeEnum && d.Type == field.TypeString:
|
||||
return true
|
||||
}
|
||||
return c.FloatType() && d.FloatType()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user