I created the first project following the instructions for the MySQL DB. Installation via npm was successful, all models recognized, no errors or warnings. I went to the forestadmin app and I see all the tables. But in those tables where there are foreign keys, an error occurs. For example, I have a simple relation one user - many characters, error when trying to view the table characters:
[forest] ��� Unexpected error: Unknown column 'characters.user_uid'
in 'on clause'
{
"name": "SequelizeDatabaseError",
"parent": {
"code": "ER_BAD_FIELD_ERROR",
"errno": 1054,
"sqlState": "42S22",
"sqlMessage": "Unknown column 'characters.user_uid' in 'on clause'",
"sql": "SELECT count(`characters`.`uid`) AS `count` FROM `characters
` AS `characters` LEFT OUTER JOIN `users` AS `userUid` ON `characters`.`
user_uid` = `userUid`.`uid` LEFT OUTER JOIN `users` AS `userUidUserUid`
ON `characters`.`user_uid` = `userUidUserUid`.`uid`;"
But there is no foreign key ‘user_uid’. Correct foreign key name is ‘userUid’. It looks like it ignores the correct foreign key name and tries to generate it according to the rule tableName+_+primaryKey.
In addition, I see strange extra associations in the table settings: userUidUserUid
- I don’t have such a table.
Context
- Database Dialect: MySQL
- Database Version: 8.0.19
- Project Name: mcm