From cc5ce81b8eccad2b8bd238883ce0bfade400dd75 Mon Sep 17 00:00:00 2001 From: Aaron L Date: Sat, 27 Aug 2016 09:51:06 -0700 Subject: [PATCH] Correct subtle issue with code that was never used --- bdb/relationships.go | 2 +- bdb/relationships_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bdb/relationships.go b/bdb/relationships.go index 212a912..968fdf8 100644 --- a/bdb/relationships.go +++ b/bdb/relationships.go @@ -72,7 +72,7 @@ func buildRelationship(localTable Table, foreignKey ForeignKey, foreignTable Tab col := foreignTable.GetColumn(foreignKey.Column) relationship := ToManyRelationship{ - Table: foreignKey.Table, + Table: foreignKey.ForeignTable, Column: foreignKey.ForeignColumn, Nullable: col.Nullable, Unique: col.Unique, diff --git a/bdb/relationships_test.go b/bdb/relationships_test.go index 1eecb39..228a76b 100644 --- a/bdb/relationships_test.go +++ b/bdb/relationships_test.go @@ -101,6 +101,7 @@ func TestToManyRelationships(t *testing.T) { ToJoinTable: false, }, { + Table: "pilots", Column: "id", Nullable: false, Unique: false, @@ -233,6 +234,7 @@ func TestToManyRelationshipsNull(t *testing.T) { ToJoinTable: false, }, { + Table: "pilots", Column: "id", Nullable: true, Unique: true,