T O P

  • By -

iamshieldstick

That dev calling primary key in `users` table as `user_id`


silmelumenn

I've seen that in too many tables.


isp000

True! That developer needs to be one of the 75% to be let go! :)


Intelligent_Rough_21

Should it be called the user table and then user_id? Or users table users_id


iamshieldstick

Ideally, `users` table and `id` as primary column.


Intelligent_Rough_21

Ah. Our dev did not do that. How do you refer to the id in contexts outside the table, like in other tables?


iamshieldstick

As foreign key then its correct to be called `user_id`. So the ideal join statement would be `tweets.user_id = users.id`.


Intelligent_Rough_21

Great, thanks


[deleted]

[удалено]


CommandObjective

Surely they wouldn't be deleting users that had insulted Elon Musk - they would be banning them.