Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dialect/sql/schema: use serial underlying types for fks #2963

Merged
merged 1 commit into from Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.