Skip to content

Commit

Permalink
make sure nullability of fk is irrelevant when checking equality
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
  • Loading branch information
erizocosmico committed Aug 1, 2017
1 parent c3ec1a9 commit 23dc27f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions generator/migration.go
Expand Up @@ -725,6 +725,7 @@ func (t *packageTransformer) applyForeignKeys() error {
schema := t.tables[table]
for _, fk := range fks {
if col := schema.Column(fk.Name); col != nil {
fk.NotNull = col.NotNull
if !col.Equals(fk) {
return fmt.Errorf("kallax: there is an inverse definition conflicting with the column definition of column %s in the table %s. Please, make sure both definitions match.", fk.Name, table)
}
Expand Down

0 comments on commit 23dc27f

Please sign in to comment.