Re: How to store a chat in a mysql db

From: J.O. Aho <user_at_example.net>
Date: Wed, 20 Mar 2019 07:03:06 +0100
Message-ID: <gfe3cqFti2tU1_at_mid.individual.net>


On 3/19/19 9:25 PM, ^Bart wrote:

>> Should be:
>>   ON UPDATE NO ACTION
>>
>> without the closing parenthesis.
>> Use the "match brackets" function of your editor to find these
>> kind of errors.

>
> Thanks, it works! :)
>
> But I didn't understood what handle field contains from the example
> https://stackoverflow.com/questions/3094495/db-schema-for-chats , I
> replaced it with a FK to the user's table, is it right?

[Quoted] The handler is the name of the user, the user_id is really just the id column of the chat_user table.

[Quoted] I think a better design had to be using a better name for the id columns in each table, like use user_id even in the chat_user table, chat_id for the chat table and so on, this makes it less likely that you make bad joins or confuse things.

-- 

  //Aho
Received on Wed Mar 20 2019 - 07:03:06 CET

Original text of this message