I want to create 2 tables.
Table 1. Entity
- Name, Address, Phone Number.
Entity could be anybody, from a customer ordering information, or whatever. Entity just holds common info about people.
Table 2. User
- Username, Password, Foreign Key Entity
User are people logging into the system. They also have a foreign key to Entity table to record their Name, Address, and Phone Number.
That part is fine.
However, what I want to do is add a foreign key from Entity back to user. The reason why I want to do this is for auditing purposes. If someone adds an Entity, I want the username to be recorded in the Entity table of who added the Entity.
Is that just crappy design? If so what is a better method?
Table 1. Entity
- Name, Address, Phone Number.
Entity could be anybody, from a customer ordering information, or whatever. Entity just holds common info about people.
Table 2. User
- Username, Password, Foreign Key Entity
User are people logging into the system. They also have a foreign key to Entity table to record their Name, Address, and Phone Number.
That part is fine.
However, what I want to do is add a foreign key from Entity back to user. The reason why I want to do this is for auditing purposes. If someone adds an Entity, I want the username to be recorded in the Entity table of who added the Entity.
Is that just crappy design? If so what is a better method?