func (e *Entity) HasMultiplePKs() bool {
	counter := 0
	for _, col := range e.Columns {
		if col.IsPK {
			counter++
		}
		if counter > 1 {
			return true
		}
	}
	return false
}
HasMultiplePKs checks if entity has many primary keys
package model
import (
	"github.com/dizzyfool/genna/util"
)
type Entity struct {
	GoName       string
	GoNamePlural string
	PGName       string
	PGSchema     string
	PGFullName   string
	ViewName string
	Columns   []Column
	Relations []Relation
	Imports []string
	colIndex util.Index
	impIndex map[string]struct{}
}
func NewEntity(schema, pgName string, columns []Column, relations []Relation) Entity {
	goName := util.EntityName(pgName)
	if schema != util.PublicSchema {
		goName = util.CamelCased(schema) + goName
	}
	goNamePlural := util.CamelCased(util.Sanitize(pgName))
	if schema != util.PublicSchema {
		goNamePlural = util.CamelCased(schema) + goNamePlural
	}
	entity := Entity{
		GoName:       goName,
		GoNamePlural: goNamePlural,
		PGName:       pgName,
		PGSchema:     schema,
		PGFullName:   util.JoinF(schema, pgName),
		Columns:   []Column{},
		Relations: []Relation{},
		colIndex:  util.NewIndex(),
		Imports:  []string{},
		impIndex: map[string]struct{}{},
	}
	if columns != nil {
		for _, col := range columns {
			entity.AddColumn(col)
		}
	}
	if relations != nil {
		for _, rel := range relations {
			entity.AddRelation(rel)
		}
	}
	return entity
}
func (e *Entity) AddColumn(column Column) {
	if !e.colIndex.Available(column.GoName) {
		column.GoName = e.colIndex.GetNext(column.GoName)
	}
	e.colIndex.Add(column.GoName)
	e.Columns = append(e.Columns, column)
	if imp := column.Import; imp != "" {
		if _, ok := e.impIndex[imp]; !ok {
			e.impIndex[imp] = struct{}{}
			e.Imports = append(e.Imports, imp)
		}
	}
}
func (e *Entity) AddRelation(relation Relation) {
	if !e.colIndex.Available(relation.GoName) {
		relation.GoName = e.colIndex.GetNext(relation.GoName + util.Rel)
	}
	e.colIndex.Add(relation.GoName)
	e.Relations = append(e.Relations, relation)
	for _, field := range relation.FKFields {
		for i, column := range e.Columns {
			if column.PGName == field {
				e.Columns[i].AddRelation(&relation)
			}
		}
	}
}