由审计列创建/更新的外键或字符串(Foreign key or string for created/updated by auditing columns)

系统教程 行业动态 更新时间:2024-06-14 17:04:02
由审计列创建/更新的外键或字符串(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

更多推荐

本文发布于:2023-04-24 20:58:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/95ab7ec31ea5064c4cc8d6a1048eba75.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   key   Foreign   string   columns

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!