# File for modifying the SQL query for create 'post'?

**URL:** <https://meta.discourse.org/t/file-for-modifying-the-sql-query-for-create-post/239173>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [September 16, 2022, 7:14am UTC](https://meta.discourse.org/t/file-for-modifying-the-sql-query-for-create-post/239173 "2022-09-16T07:14:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [September 16, 2022, 7:27am UTC](https://meta.discourse.org/t/file-for-modifying-the-sql-query-for-create-post/239173/2 "2022-09-16T07:27:12Z")

</div>

Modifying such a key table directly is probably risky, consider instead using the `PostCustomField` model, it exists for exactly this kind of purpose: to attach bespoke custom data to Posts, usually in a plugin.

> <https://github.com/discourse/discourse/blob/main/app/models/post_custom_field.rb>

If you have performance issues then maybe you can revisit, but this is a much simpler and safer solution.

---

_[View the full topic](https://meta.discourse.org/t/file-for-modifying-the-sql-query-for-create-post/239173)._
