format code (#884)

This commit is contained in:
Kevin Wan
2021-08-09 18:11:08 +08:00
committed by GitHub
parent a74aaf1823
commit 02adcccbf4
4 changed files with 13 additions and 15 deletions

View File

@@ -7,16 +7,14 @@ import (
"github.com/tal-tech/go-zero/core/stores/sqlx"
)
var (
p2m = map[string]string{
"int8": "bigint",
"numeric": "bigint",
"float8": "double",
"float4": "float",
"int2": "smallint",
"int4": "integer",
}
)
var p2m = map[string]string{
"int8": "bigint",
"numeric": "bigint",
"float8": "double",
"float4": "float",
"int2": "smallint",
"int4": "integer",
}
// PostgreSqlModel gets table information from information_schema、pg_catalog
type PostgreSqlModel struct {
@@ -173,7 +171,7 @@ func (m *PostgreSqlModel) getIndex(schema, table string) (map[string][]*DbIndex,
if err != nil {
return nil, err
}
var index = make(map[string][]*DbIndex)
index := make(map[string][]*DbIndex)
for _, e := range indexes {
if e.IsPrimary.Bool {
index[e.ColumnName.String] = append(index[e.ColumnName.String], &DbIndex{