|
|
|
@ -7,8 +7,7 @@ import (
|
|
|
|
|
"github.com/tal-tech/go-zero/core/stores/sqlx"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
p2m = map[string]string{
|
|
|
|
|
var p2m = map[string]string{
|
|
|
|
|
"int8": "bigint",
|
|
|
|
|
"numeric": "bigint",
|
|
|
|
|
"float8": "double",
|
|
|
|
@ -16,7 +15,6 @@ var (
|
|
|
|
|
"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{
|
|
|
|
|