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 6e36377
Show file tree
Hide file tree
Showing 21 changed files with 2,302 additions and 23 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
117 changes: 117 additions & 0 deletions entc/integration/migrate/entv2/blog.go

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

42 changes: 42 additions & 0 deletions entc/integration/migrate/entv2/blog/blog.go

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

144 changes: 144 additions & 0 deletions entc/integration/migrate/entv2/blog/where.go

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

0 comments on commit 6e36377

Please sign in to comment.