Answer the question
In order to leave comments, you need to log in
How to store user categories in postgres?
There is a table of categories and users, you need to make a way to bind several categories to a user.
How can this be implemented, so that later you can search by user depending on the filter by category?
I can't think of a better option and there are no answers on Google.
Answer the question
In order to leave comments, you need to log in
Standard many-to-many relationship via link table
users
__________
id
name
...
categories
__________
id
name
...
user_categories
__________
user_id
category_id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question