diff --git a/bdb/drivers/mock.go b/bdb/drivers/mock.go index c10ff95..b4c1943 100644 --- a/bdb/drivers/mock.go +++ b/bdb/drivers/mock.go @@ -59,15 +59,15 @@ func (m *MockDriver) Columns(tableName string) ([]bdb.Column, error) { func (m *MockDriver) ForeignKeyInfo(tableName string) ([]bdb.ForeignKey, error) { return map[string][]bdb.ForeignKey{ "jets": { - {Name: "jets_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, - {Name: "jets_airport_id_fk", Column: "airport_id", ForeignTable: "airports", ForeignColumn: "id"}, + {Table: "jets", Name: "jets_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, + {Table: "jets", Name: "jets_airport_id_fk", Column: "airport_id", ForeignTable: "airports", ForeignColumn: "id"}, }, "licenses": { - {Name: "licenses_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, + {Table: "licenses", Name: "licenses_pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, }, "pilot_languages": { - {Name: "pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, - {Name: "jet_id_fk", Column: "language_id", ForeignTable: "languages", ForeignColumn: "id"}, + {Table: "pilot_languages", Name: "pilot_id_fk", Column: "pilot_id", ForeignTable: "pilots", ForeignColumn: "id"}, + {Table: "pilot_languages", Name: "jet_id_fk", Column: "language_id", ForeignTable: "languages", ForeignColumn: "id"}, }, }[tableName], nil } diff --git a/text_helpers_test.go b/text_helpers_test.go index 3fbe655..aa574ad 100644 --- a/text_helpers_test.go +++ b/text_helpers_test.go @@ -59,6 +59,7 @@ func TestTextsFromOneToOneRelationship(t *testing.T) { expect := RelationshipToOneTexts{} expect.ForeignKey = bdb.ForeignKey{ + Table: "jets", Name: "none", Column: "id", Nullable: false,