Size: a a a

2020 June 16

IZ

Ilia Zviagin in MySQL
Denis Efremov
Ну вот у меня шахматы. Таблица игр и таблица юзеров. Как мне реализовать?
Или

Игра
Ид, прочие атрибуты.
Состав игроков
Ид игры, игрок -
Игрок, - ссылка на таблицу пользователей.
источник

DE

Denis Efremov in MySQL
источник

DE

Denis Efremov in MySQL
источник

IZ

Ilia Zviagin in MySQL
Ну типа того, да.
источник

IZ

Ilia Zviagin in MySQL
Denis Efremov
Agreed, but actually it does not annoying...
Is not annoying .
источник

V

VIJAY WILFRED in MySQL
Hi Denis please recheck your code because you are referencing the "id" in the table "users".
источник

DE

Denis Efremov in MySQL
VIJAY WILFRED
Hi Denis please recheck your code because you are referencing the "id" in the table "users".
Yes. But what should I reference instead?
источник

DE

Denis Efremov in MySQL
VIJAY WILFRED
Hi Denis please recheck your code because you are referencing the "id" in the table "users".
источник

V

VIJAY WILFRED in MySQL
Hi Denis the error is due to "whites_id" column because the same column should be there in "users" table.
источник

DE

Denis Efremov in MySQL
https://github.com/Piterden/chessbot/blob/dev/migrations/20180410134324_create_moves_table.js#L11

This works fine. There shouldn't be the same column. Why do you think so?
источник

V

VIJAY WILFRED in MySQL
Hi Denis when you are try to have a relationship between two tables like Master and Transaction Table you need to have same column in both tables or you will get a error cannot add Foreign Key Constraint.
источник

DE

Denis Efremov in MySQL
VIJAY WILFRED
Hi Denis when you are try to have a relationship between two tables like Master and Transaction Table you need to have same column in both tables or you will get a error cannot add Foreign Key Constraint.
What do you mean the same?
источник

V

VIJAY WILFRED in MySQL
Denis Efremov
What do you mean the same?
The Column name which you have created "whites_id" should be there in "users" table.
источник

DE

Denis Efremov in MySQL
VIJAY WILFRED
The Column name which you have created "whites_id" should be there in "users" table.
Why?
источник

V

VIJAY WILFRED in MySQL
Hi Denis for this issue you can refer this URL https://www.mysqltutorial.org/mysql-foreign-key/
источник

DE

Denis Efremov in MySQL
источник

V

VIJAY WILFRED in MySQL
источник

DE

Denis Efremov in MySQL
It's bullshit. I found the solution already, and I haven't changed names.
источник

НА

Николай Алиферов... in MySQL
Уран с нами)
источник

DE

Denis Efremov in MySQL
источник