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

This commit is contained in:
Ariel Mashraki
2022-09-27 07:54:07 +03:00
committed by GitHub
parent 679109f5c2
commit e93e96ed1b
21 changed files with 2301 additions and 23 deletions

View File

@@ -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