[nycphp-talk] DB Schema for storing revision history?
David Krings
ramons at gmx.net
Wed Jun 27 20:28:57 EDT 2007
Steve Francia wrote:
> The version table would have the document_id, content and the mod_date
> and author_id.
I am by no means a database expert, but why would one want to store
guaranteed to be static data in a table such as the content. That
content will never ever change. I agree with all other parts of your
proposal, but recommend to store only a file path to each version of the
file to keep the static bloat as small as possible.
Since it is to be simple, I wouldn't bother with an author ID as this
requires author account management, although it isn't that complex.
Another thing to think about is to have some sort of logging and allow
the system to delete content. In that case you'd need a "Deleted" column
that keeps track of what is marked as deleted and what not. Taking the
rows out of the table will corrupt the logging, especially when dealing
with author accounts, which also need a "Deleted" column in case one
takes one author account out.
Anything more complicated than that is probably better done with a real
version control system as proposed by others.
Just my 2€ on top the ones I already put on the table. ;)
David
More information about the talk
mailing list