Skip to content

Commit

Permalink
dialect/sql/schema: use serial underlying types for fks
Browse files Browse the repository at this point in the history
  • Loading branch information
a8m committed Sep 26, 2022
1 parent 7ad7df2 commit 1eb7494
Show file tree
Hide file tree
Showing 15 changed files with 586 additions and 20 deletions.
3 changes: 3 additions & 0 deletions dialect/sql/schema/postgres.go
Expand Up @@ -690,6 +690,9 @@ func (d *Postgres) atTypeC(c1 *Column, c2 *schema.Column) error {
return err
}
c2.Type.Type = t
if s, ok := t.(*postgres.SerialType); c1.foreign != nil && ok {
c2.Type.Type = s.IntegerType()
}
return nil
}
var t schema.Type
Expand Down
16 changes: 16 additions & 0 deletions entc/integration/migrate/entv2/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions entc/integration/migrate/entv2/group.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions entc/integration/migrate/entv2/group/group.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions entc/integration/migrate/entv2/group/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 50 additions & 3 deletions entc/integration/migrate/entv2/group_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 82 additions & 2 deletions entc/integration/migrate/entv2/group_query.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1eb7494

Please sign in to comment.