Support the ongoing development of Laravel.io →
Database Architecture
Last updated 2 years ago.
0

i use created_by, updated_by and deleted_by too

0

extjac said:

i use created_by, updated_by and deleted_by too

do you use the user ID or user name?

0

dont use username or user_id. There are many ways you can do this...Simple or Complex....but I would not use useranme for sure

0

i think it depends.. if you ALLOW your user to change their username then don't use them.. but even if you do ID (number) is a better strategy.. to avoid code error in terms of querying data.. performance might be better with ID too (not verified).

0

Yes my problem would be that the name could change, e.g if somebody gets married.

@extjac so what solution do you use?

0

When you're making a reference like this, you want to use a data-point that is non-volatile as a reference.

In most situations, I don't care what the username of the person who made the change was as much as I care what person it actually was. So I would use user_id as the reference. Further, you can combine it with soft-deletes on the Users model so that even if a user has been deleted, you still have records of the changes they had made.

0

It can help but for me i am looking for software that can give backup as for now and with backup and recovery software also, My friends recommended me of "Ahsay software" they say they are using it for Business use only so "Ahsay software" is in my list but need more recommendations.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

ale1981 ale1981 Joined 6 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.