# Issue in generated \`schema.rs\` when calling columns \`type\`

**URL:** <https://discourse.diesel.rs/t/issue-in-generated-schema-rs-when-calling-columns-type/173>\
**Category:** Diesel 2.0\
**Created:** [August 2, 2020, 12:58am UTC](https://discourse.diesel.rs/t/issue-in-generated-schema-rs-when-calling-columns-type/173 "2020-08-02T00:58:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gas](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@gas](https://discourse.diesel.rs/u/gas)\
**Post date:** [August 2, 2020, 12:58am UTC](https://discourse.diesel.rs/t/issue-in-generated-schema-rs-when-calling-columns-type/173/1 "2020-08-02T00:58:23Z")

</div>

When a column called `type` is used to contain foreign keys the `schema.rs` will contain `joinable!(table_having_type_as_foreign_key -> types (type));` although it should be `joinable!(table_having_type_as_foreign_key -> types (type_));`. Is there anything I can do to avoid this as calling `diesel migration run` breaks `schma.rs`?

---

<div class="post-metadata">

**Author:** ![weiznich](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.diesel.rs/weiznich/32/64_2.png) [@weiznich](https://discourse.diesel.rs/u/weiznich)\
**Post date:** [August 3, 2020, 10:13am UTC](https://discourse.diesel.rs/t/issue-in-generated-schema-rs-when-calling-columns-type/173/2 "2020-08-03T10:13:42Z")

</div>

See [https://github.com/diesel-rs/diesel/pull/1897](https://github.com/diesel-rs/diesel/pull/1897) for an fix. That should be included in the next release.
