update goctl to go 1.16 for io/fs usage (#1571)

* update goctl to go 1.16 for io/fs usage

* feat: support pg serial type for auto_increment (#1563)

* add correct example for pg's url

* 🐞 fix: merge

* 🐞 fix: pg default port

*  feat: support serial type

Co-authored-by: kurimi1 <d0n41df@gmail.com>

* chore: format code

Co-authored-by: toutou_o <33993460+kurimi1@users.noreply.github.com>
Co-authored-by: kurimi1 <d0n41df@gmail.com>
This commit is contained in:
Kevin Wan
2022-02-24 13:58:53 +08:00
committed by GitHub
parent 3b07ed1b97
commit e0454138e0
13 changed files with 28 additions and 19 deletions

View File

@@ -108,6 +108,7 @@ func (m *PostgreSqlModel) getColumns(schema, table string, in []*PostgreColumn)
if err != nil {
return nil, err
}
var list []*Column
for _, e := range in {
var dft interface{}
@@ -120,7 +121,7 @@ func (m *PostgreSqlModel) getColumns(schema, table string, in []*PostgreColumn)
isNullAble = "NO"
}
extra := ""
var extra string
// when identity is true, the column is auto increment
if e.IdentityIncrement.Int32 == 1 {
extra = "auto_increment"
@@ -178,6 +179,7 @@ func (m *PostgreSqlModel) getIndex(schema, table string) (map[string][]*DbIndex,
if err != nil {
return nil, err
}
index := make(map[string][]*DbIndex)
for _, e := range indexes {
if e.IsPrimary.Bool {
@@ -199,6 +201,7 @@ func (m *PostgreSqlModel) getIndex(schema, table string) (map[string][]*DbIndex,
SeqInIndex: int(e.IndexSort.Int32),
})
}
return index, nil
}