Correct subtle issue with code that was never used

This commit is contained in:
Aaron L 2016-08-27 09:51:06 -07:00
parent 1887f23ca5
commit cc5ce81b8e
2 changed files with 3 additions and 1 deletions

View file

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

View file

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