support db_type in ddl (#5404)

* support db_type in ddl

* postgres test fixed

* CHANGELOG.md

* mysql bug
This commit is contained in:
smx_Morgan
2023-09-14 21:59:30 +08:00
committed by GitHub
parent b2a37fe60e
commit c55099756c
5 changed files with 17 additions and 3 deletions

View File

@@ -140,6 +140,7 @@ type FieldInfo struct {
OnDelete string
Description string
TimePrecision *int
DBType string
}
// NewFieldInfo new field info
@@ -308,6 +309,7 @@ checkType:
fi.Null = attrs["null"]
fi.Index = attrs["index"]
fi.Auto = attrs["auto"]
fi.DBType = tags["db_type"]
fi.Pk = attrs["pk"]
fi.Unique = attrs["unique"]

View File

@@ -48,6 +48,7 @@ var supportTag = map[string]int{
"type": 2,
"description": 2,
"precision": 2,
"db_type": 2,
}
type fn func(string) string