Legacy corteza server 2022.9.x fix missing col type (#505)
* Add support for dropdowns field type in physical tables
This commit is contained in:
@@ -216,6 +216,9 @@ func (mysqlDialect) AttributeToColumn(attr *dal.Attribute) (col *ddl.Column, err
|
||||
case *dal.TypeUUID:
|
||||
col.Type.Name = "CHAR(36)"
|
||||
|
||||
case *dal.TypeEnum:
|
||||
col.Type.Name = "TEXT"
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported column type: %s ", t.Type())
|
||||
}
|
||||
|
||||
@@ -199,6 +199,9 @@ func (postgresDialect) AttributeToColumn(attr *dal.Attribute) (col *ddl.Column,
|
||||
case *dal.TypeUUID:
|
||||
col.Type.Name = "UUID"
|
||||
|
||||
case *dal.TypeEnum:
|
||||
col.Type.Name = "TEXT"
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported column type: %s ", t.Type())
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ func (sqliteDialect) AttributeCast(attr *dal.Attribute, val exp.Expression) (exp
|
||||
}
|
||||
|
||||
func (sqliteDialect) AttributeToColumn(attr *dal.Attribute) (col *ddl.Column, err error) {
|
||||
|
||||
col = &ddl.Column{
|
||||
Ident: attr.StoreIdent(),
|
||||
Comment: attr.Label,
|
||||
@@ -204,6 +205,8 @@ func (sqliteDialect) AttributeToColumn(attr *dal.Attribute) (col *ddl.Column, er
|
||||
case *dal.TypeUUID:
|
||||
col.Type.Name = "CHAR(36)"
|
||||
|
||||
case *dal.TypeEnum:
|
||||
col.Type.Name = "TEXT"
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported column type: %s ", t.Type())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user