Help please solve the following situation:
There are two kinds of API where message history is stored, it’s Zopim and Chat2Desc (import into Postman). While these two but can then others appear.
And my database with the
Table users id , email, phone, ...
In Zopim, users are identified via email, and in Chat2Desc through the phone. For me, these two fields are important, whatever the chat was and how many would not be.
That is, if I receive an email or a user’s phone in messages, I make a request to my database (
table users) to identify my user.
And in principle, even the structure of chat rooms is not important.I’ll somehow choose them.And here’s how to properly save them, so much so that I had one structure for everyone.
And that’s what I came up with (Something I don’t like, especially the
chats (Data for chat):
client_id– indicates the id of the
duration– the duration of the chat (120 seconds)
system_type– stores the name of the chat (Zopim, Chat2Desc, …)
created_at– creation date
chat_clients (information about users who were in the chat):
is_agent– 0 | 1: 1 => my user, 0 => not my
user_id– is the user id. Contains either id from the users table or empty.
assigned_data– those initials under which users were in the chat
bean_module– it does not matter (information about my user)
unique_col– There will either be a email (from Zopim) or a phone (from Chat2Desc, Or I think to store the id of the users table). Will guarantee the uniqueness of the values.
The users_id + unique_col bunch is unique (
UNIQUE KEY user_id_unique_col_UQ (user_id, unique_col))
text– the text of the message.
client_id– indicates the id of the chat_clients table
chat_id– indicates the id of the table chats
file_id– indicates the id of the chat_files table
transport– the value will be for Chat2Desc (Viber, WhatsApp, …), for Zopim, so it’s not empty, Zopim
chat_files Information about the transferred files in the chat. Analogical tables may be not to store additional information.
Q: How can I improve the structure of tables to get more flexibility ?
Thank you in advance.
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!