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

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