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?
Managed to expose these routes by mimicking an existing plugin and how they went about doing it, I’m not sure if there is documentation out there for these things but it doesn’t seem very easy to find from google searches etc.
Are there any plans in the near future to improve the documentation for these things? Thanks for pointing me in the right general direction, though those files provide little context on how to make use of those methods.
hi! I am in exact neer of what you described in your post. I see that you were able to accomplish that by mimicking sone exisiting plugin? May I ask exactly which plugin did you copy? Can you please give some pointers?
What I am trying to accomplish is to add some extra fields to the topics table in DB and then get/put data in those fields with REST api.
I think its better to do migrations like the polls plugin. I created a migration and model generator for plugins: GitHub - spirobel/discourse at plugin_model_and_migrations It puts the migration files at the same spot like in the polls plugin.