mirror of
https://github.com/ent/ent.git
synced 2026-05-02 23:50:54 +03:00
dialect/sql/schema: add optional schema-type to column spec (#461)
This commit is contained in:
@@ -256,6 +256,9 @@ func (d *Postgres) tBuilder(t *Table) *sql.TableBuilder {
|
||||
|
||||
// cType returns the PostgreSQL string type for this column.
|
||||
func (d *Postgres) cType(c *Column) (t string) {
|
||||
if c.SchemaType != nil && c.SchemaType[dialect.Postgres] != "" {
|
||||
return c.SchemaType[dialect.Postgres]
|
||||
}
|
||||
switch c.Type {
|
||||
case field.TypeBool:
|
||||
t = "boolean"
|
||||
|
||||
Reference in New Issue
Block a user