From 23dc27fe582f5bed5e824f329a827a8779fd2aad Mon Sep 17 00:00:00 2001 From: Miguel Molina Date: Tue, 1 Aug 2017 14:24:49 +0200 Subject: [PATCH] make sure nullability of fk is irrelevant when checking equality Signed-off-by: Miguel Molina --- generator/migration.go | 1 + 1 file changed, 1 insertion(+) diff --git a/generator/migration.go b/generator/migration.go index fc88d2c..febfe50 100644 --- a/generator/migration.go +++ b/generator/migration.go @@ -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) }