Skip to content

Commit

Permalink
fix: apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Jul 19, 2022
1 parent f2c4991 commit 643d7c4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/entimport/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func resolvePrimaryKey(field fieldFunc, table *schema.Table) (f ent.Field, err e
return nil, fmt.Errorf("entimport: missing primary key (table: %v)", table.Name)
}
if len(table.PrimaryKey.Parts) != 1 {
return nil, fmt.Errorf("entimport: invalid primary key - single part key must be present (table: %v, got: %v parts)", table.Name, len(table.PrimaryKey.Parts))
return nil, fmt.Errorf("entimport: invalid primary key, single part key must be present (table: %v, got: %v parts)", table.Name, len(table.PrimaryKey.Parts))
}
if f, err = field(table.PrimaryKey.Parts[0].C); err != nil {
return nil, err
Expand Down
1 change: 0 additions & 1 deletion internal/entimport/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ func (m *MySQL) SchemaMutations(ctx context.Context) ([]schemast.Mutator, error)
for _, t := range s.Tables {
if !excludedTableNames[t.Name] {
tables = append(tables, t)
} else {
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions internal/entimport/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func (p *Postgres) SchemaMutations(ctx context.Context) ([]schemast.Mutator, err
for _, t := range s.Tables {
if !excludedTableNames[t.Name] {
tables = append(tables, t)
} else {
}
}
}
Expand Down Expand Up @@ -81,7 +80,7 @@ func (p *Postgres) field(column *schema.Column) (f ent.Field, err error) {
case *postgres.UUIDType:
f = field.UUID(name, uuid.New())
default:
return nil, fmt.Errorf("column %v: unsupported type %q", column.Name, typ)
return nil, fmt.Errorf("entimport: unsupported type %q for column %v", typ, column.Name)
}
applyColumnAttributes(f, column)
return f, err
Expand Down

0 comments on commit 643d7c4

Please sign in to comment.