Skip to content

Commit 23dc27f

Browse files
committed
make sure nullability of fk is irrelevant when checking equality
Signed-off-by: Miguel Molina <[email protected]>
1 parent c3ec1a9 commit 23dc27f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

generator/migration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,7 @@ func (t *packageTransformer) applyForeignKeys() error {
725725
schema := t.tables[table]
726726
for _, fk := range fks {
727727
if col := schema.Column(fk.Name); col != nil {
728+
fk.NotNull = col.NotNull
728729
if !col.Equals(fk) {
729730
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)
730731
}

0 commit comments

Comments
 (0)