# Create custom db table and fields from plugin

**URL:** <https://meta.discourse.org/t/create-custom-db-table-and-fields-from-plugin/36164>\
**Category:** Development\
**Created:** [November 30, 2015, 6:09pm UTC](https://meta.discourse.org/t/create-custom-db-table-and-fields-from-plugin/36164 "2015-11-30T18:09:49Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![deviousmachin3](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@deviousmachin3](https://meta.discourse.org/u/deviousmachin3)\
**Post date:** [November 30, 2015, 6:09pm UTC](https://meta.discourse.org/t/create-custom-db-table-and-fields-from-plugin/36164/1 "2015-11-30T18:09:49Z")

</div>

Hi everyone, I’m working on developing a new plugin and I need to store some values in the database but I do not want to modify the discourse base system in any fashion. I’ve read through the beginners guide on plugin development and I did not see anything addressing this, essentially what i need is a table that has two fields that reference a single user that links another user or multiple users.

database → plugin\_users → column 1 would be user\_id and column 2 could be a comma separated list of user\_ids.

Ideally I would also be able to query this data to pull those values from an XHR request, as well as set those values via an xhr request, is this possible with the current discourse plugin model and if so how would one go about integrating this?

---

_[View the full topic](https://meta.discourse.org/t/create-custom-db-table-and-fields-from-plugin/36164)._
