mirror of
https://github.com/ent/ent.git
synced 2026-05-22 09:31:45 +03:00
ent: add blob tyoe
Reviewed By: idoshveki Differential Revision: D16600425 fbshipit-source-id: 04c6fe39f9b3b628a1e79eb3063188f582d9e504
This commit is contained in:
committed by
Facebook Github Bot
parent
2d962d5cba
commit
c203f043cf
@@ -176,6 +176,8 @@ func (c *Column) MySQLType(version string) (t string) {
|
||||
t = "bigint"
|
||||
case field.TypeUint, field.TypeUint64:
|
||||
t = "bigint unsigned"
|
||||
case field.TypeBytes:
|
||||
t = "blob"
|
||||
case field.TypeString:
|
||||
size := c.Size
|
||||
if size == 0 {
|
||||
@@ -211,6 +213,8 @@ func (c *Column) SQLiteType() (t string) {
|
||||
t = "integer"
|
||||
case field.TypeInt64, field.TypeUint64:
|
||||
t = "bigint"
|
||||
case field.TypeBytes:
|
||||
t = "blob"
|
||||
case field.TypeString:
|
||||
size := c.Size
|
||||
if size == 0 {
|
||||
@@ -279,6 +283,8 @@ func (c *Column) ScanMySQL(rows *sql.Rows) error {
|
||||
c.Type = field.TypeFloat64
|
||||
case "timestamp":
|
||||
c.Type = field.TypeTime
|
||||
case "blob":
|
||||
c.Type = field.TypeBytes
|
||||
case "varchar":
|
||||
c.Type = field.TypeString
|
||||
size, err := strconv.Atoi(parts[1])
|
||||
|
||||
Reference in New Issue
Block a user