# Errore: PG::UndefinedColumn. Il campo personalizzato non crea una colonna

**URL:** <https://meta.discourse.org/t/error-pg-undefinedcolumn-custom-field-not-creating-column/200115>\
**Category:** Support\
**Created:** [11 Agosto 2021, 9:01pm UTC](https://meta.discourse.org/t/error-pg-undefinedcolumn-custom-field-not-creating-column/200115 "2021-08-11T21:01:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [11 Agosto 2021, 10:25pm UTC](https://meta.discourse.org/t/error-pg-undefinedcolumn-custom-field-not-creating-column/200115/4 "2021-08-11T22:25:08Z")

</div>

Non riesco a trovare un TopicCustomField in questo momento (ma ti ho detto dove guardare! :wink)

Ecco questo:

```plaintext
[4] pry(main)> CategoryCustomField.last
=> #<CategoryCustomField:0x000055be74a00bd0
 id: 2,
 category_id: 8,
 name: "enable_accepted_answers",
 value: "true",
 created_at: Mon, 26 Apr 2021 15:45:07.862617000 UTC +00:00,
 updated_at: Mon, 26 Apr 2021 15:45:07.862617000 UTC +00:00>

```

Quindi qualcosa del genere:

```plaintext
tcf=TopicCustomField.where(name: 'fun_level', value: 'super-duper-fun')

```

Poi puoi ottenere l’`topic_id` e così via da `tcf` (è un array di tutte le corrispondenze). Se conosci l’`topic_id`, puoi fare un `TopicCustomField.find_by(<tutti e tre gli elementi per renderlo unico>)`.

---

_[View the full topic](https://meta.discourse.org/t/error-pg-undefinedcolumn-custom-field-not-creating-column/200115)._
