musonza / chat

A Laravel chat package. You can use this package to create a chat/messaging Laravel application.
MIT License
1.13k stars 311 forks source link

Compatibility problems with MYSQL 5.6 #38

Closed iamNikitaValty closed 6 years ago

iamNikitaValty commented 6 years ago

Hi, I installed this bundle in My Laravel project but I can’t stop having this error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '>'$."message_id"' = mc_messages.id where mc_messages.conversation_id in ' at line 1 (SQL: select notifications., mc_messages. from mc_messages inner join notifications on notifications.data->'$."message_id"' = mc_messages.id where mc_messages.conversation_id in (16, 31, 7, 35, 36) order by mc_messages.id desc) ` Trying to understand the error makes me understand that it is about the version of MYSQL. I was actually using version 5.6.38 I used a different database with MyQL 5.7.18 and everything worked fine. How could we address this issue? The problem is that i even tried to debug the code in other to find where the problem occurs and try to fix it but it seems really complicated. By the way I cannot just comment the package code in my local version cause it wouldn’t work on production anyway. I should notice that the MYSQL requirements are not specified in the package documentation.

My Laravel version is 5.3.31

musonza commented 6 years ago

@iamNikitaValty yes MySQL version is the issue. You need at least MySQL 5.7. I need to add that in the requirements. https://github.com/musonza/chat/issues/37

You could use an older version below but the api is slightly different. https://github.com/musonza/chat/tree/1.0

iamNikitaValty commented 6 years ago

Ok @musonza . ugh! So i will need to restart all this...

Thank you for your answer. I'll try doing it this way, or i'll find out how i can upgrade my Mysql ...