S
S
Staschik2020-09-21 08:31:16
Database design
Staschik, 2020-09-21 08:31:16

How to organize a database with three tables and many-to-many relationships?

Base for discord bot. Discord has servers (table guild), users (user), user roles on the server (role).
5f682574cd4d8289716279.png
A server can have many users and roles. A user can be a member of many servers and have many roles. I can't think of a base plan. So far I've settled on two options.
The first one seems simpler:
5f6838afa0a7b453702735.png
The second one seems more logical:
5f6838c3d3337561699930.png
What would be more correct?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2020-09-21
@staschik

Сервер: код, название, настройки
Роль: код, название

Настройки роли: код, код названия, код сервера, настройки

Пользователь: код, имя
Настройки пользователя: код пользователя, код настройки роли

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question