我认为你所拥有的大部分都很好。我只是在展示设计的增加或改变,快速但粗略的估计:
user
user_id
network_username ("Or Active Directory Name or whatever, you get the idea.
Using user_id as a foreign key in other tables instead of the network
name makes it easier if account names change.")
role
----
role_id
name
user_role
---------
user_role_id
role_id
user_id
page
----
page_id
author_user_id
page_comment
------------
page_comment_id
parent_page_comment_id ("Self reference to allow for nested comments")
page_id ("Even though you could conceivably look up page_id via
parent_page_comment_id if you're dealing with a nested comment, that
would involve N nested queries... so it's probably good to require this
field be populated for every single record")
user_id
permission
----------
permission_id
page_id
role_id ("To simplify, I'd stick solely to role-based access.")
history
-------
history_id ("If you have high-volume edits, you may need to use date AND this
to establish the order changes were made in. Probably safest to use both
right from the start.")
page_id
user_id ("caveat: you won't know what role the user was in when a change was
made.")
old_title ("I'd prefix "old_" to all the fields just to make it intuitively
clear.")