开发者

Database design for document management?

We are providing document upload on different things like tasks, feeds, comments etc.. And there are lots different permission on documents for which user can share it or download it. Document is private or public.

We already have legacy code and database but it's not maintainable and scalable.

I want to get idea how should I have to design a dat开发者_开发百科abase which covers all this scenarios. And it will be maintainable and scalable for other users.

Any example or solution ?


I'm not sure what exactly you mean by "upload on tasks, feeds, comments, etc." It would be useful if you could provide more detail or even the legacy database structure. Here's a general idea, though...

--users--
uid
name
email
(etc)

--comments--
cid
uid
docid
date
text

--documents--
docid
uid
upload_date
(etc)

--permissions--
pid
docid
uid

The "comments" table would be for comments on the document (if that's what you were looking for?). The "permissions" table is just a list of document ids and user ids who are allowed to access the document. Or, you could even define permissions via groups of users (which would require another table, but you get the idea).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜