# 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:** 1

<div class="post-metadata">

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

</div>

Hi guys, to give some background, I’m trying to add another column to the table schema of `posts` table, I want to add another column which is `meta_tag_id`. I got to a point where I can pass the data that I want to store in the parameters of `PostController`, check the log below for reference(this is from the logs of `d/rails s`):

```plaintext
Started POST "/posts" for 127.0.0.1 at 2022-09-16 06:08:19 +0000
Processing by PostsController#create as */*
  Parameters: {"raw"=>"Another dummy reply, for testing purposes.", "unlist_topic"=>"false", "category"=>"5", "topic_id"=>"23", "is_warning"=>"false", "archetype"=>"regular", "typing_duration_msecs"=>"4500", "composer_open_duration_msecs"=>"11534", "featured_link"=>"", "shared_draft"=>"false", "draft_key"=>"topic_23", "meta_tag_id"=>"summary", "nested_post"=>"true"}

```

Now, what I want to achieve is to insert the `meta_tag_id` parameter ☝ in another column of the `posts` table, for reference, here is a sample logs of the SQL query when inserting a record in my `posts` table:

```plaintext
Post Create (1.1ms) INSERT INTO "posts" ("user_id", "topic_id", "post_number", "raw", "cooked", "created_at", "updated_at", "sort_order", "last_editor_id", "last_version_at", "word_count", "baked_at", "baked_version") VALUES (1, 23, 7, 'Another dummy reply, for testing purposes.', '<p>Another dummy reply, for testing purposes.</p>', '2022-09-16 06:08:22.283658', '2022-09-16 06:08:22.283658', 7, 1, '2022-09-16 06:08:22.293786', 6, '2022-09-16 06:08:22.283601', 2) RETURNING "id"

```

I would be grateful if you guys could point me in the right direction. I’m not familiar with ruby, so I’m having a hard time finding the find that I should modify to achieve the adding of a new column and incorporating the `meta_tag_id` variable to the values of the query. Thank you in advance guys! 😄

---

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