dialect/sql/schema: add optional schema-type to column spec (#461)

This commit is contained in:
Ariel Mashraki
2020-05-04 20:16:43 +03:00
committed by GitHub
parent b456251154
commit 51cdda421f
7 changed files with 34 additions and 17 deletions

View File

@@ -159,6 +159,9 @@ func (d *MySQL) tBuilder(t *Table) *sql.TableBuilder {
// cType returns the MySQL string type for the given column.
func (d *MySQL) cType(c *Column) (t string) {
if c.SchemaType != nil && c.SchemaType[dialect.MySQL] != "" {
return c.SchemaType[dialect.MySQL]
}
switch c.Type {
case field.TypeBool:
t = "boolean"