entity framework - Where to place auditing fields? -


in our shop, when design database, typically include auditing attributes each table (lastupdateuser, lastupdatedate, etc). common practice, however, i've noticed becoming increasing problem when have tables "inherit" other tables, using tools such entity framework.

for example, if have tables customers , employees, , tables have foreign key table people, in entity / class model when establish inheritance, need change names audit fields because exist in both tables. perhaps need become personlastupdateduser , personlastupdateddate, while ones employees remain lastupdateduser , lastupdateddate.

when designing tables inheritance, put such audit fields in both tables, or have them in parent table , update parent table whenever attribute changes in child table?

if want use inheritance attributes belong parent table because parent related table forms single entity , track auditing whole entity. if reason needs attributes in both tables should first warning tables not candidates inheritance.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -