由审计列创建/更新的外键或字符串(Foreign key or string for created/updated by auditing columns)
在以前的数据库架构设计中,我在created_by和updated_by列中使用了自由文本字符串。
在此应用程序中,所有用户在首次登录时都会自动在USERS表中创建记录。我应该使用USERS的外键作为created_by和updated_by值吗?
USER记录很可能永远不会被删除,只是标记为这样。
In previous DB schema designs I have used free-text strings in created_by and updated_by columns.
In this application all users will automatically have a record created in the USERS table when they first log in. Should I use a foreign key to USERS as the created_by and updated_by value?
It is likely that a USER record would never actually be deleted, merely marked as such.
最满意答案
我建议在这里使用外键,因为将来会使用这些列来跟踪系统中的用户活动
I would suggest here to use foreign key here because these columns would be used in future to track the users activity in the system
更多推荐
发布评论