# Adding jsonb columns for custom fields

**URL:** <https://meta.discourse.org/t/adding-jsonb-columns-for-custom-fields/93418>\
**Category:** Development\
**Created:** [7월 29, 2018, 6:55오후 UTC](https://meta.discourse.org/t/adding-jsonb-columns-for-custom-fields/93418 "2018-07-29T18:55:48Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![gdpelican](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gdpelican/32/81308_2.png) [@gdpelican](https://meta.discourse.org/u/gdpelican)\
**Post date:** [7월 29, 2018, 6:55오후 UTC](https://meta.discourse.org/t/adding-jsonb-columns-for-custom-fields/93418/1 "2018-07-29T18:55:48Z")

</div>

Often times when developing plugins, I’ve had to use the CustomField or PluginRowStore tables to store arbitrary data related to the plugin (for example, [retort](https://meta.discourse.org/t/retort-a-reaction-style-plugin-for-discourse/35903) stores a string representation of reactions to a particular post as a PostCustomField)

This works well for simple data, but for anything a bit more complex, I’ve found myself wanting access to more than a postgres `text`-valued column can provide. Postgres has supported the jsonb column type for several versions now ([since 9.4](https://www.postgresql.org/docs/9.4/static/datatype-json.html)), which provides some super-great features like finding and filtering by nested json fields, as well as indexing.

I wonder what the feasibility would be of adding a jsonb column to PluginStoreRow, or possibly converting the existing `value` column to jsonb to allow for more complicated models to be stored there?

---

_[View the full topic](https://meta.discourse.org/t/adding-jsonb-columns-for-custom-fields/93418)._
