NYCPHP Meetup

NYPHP.org

[nycphp-talk] DB Schema for storing revision history?

Jon Baer jonbaer at jonbaer.com
Wed Jun 27 21:10:34 EDT 2007


Another pretty cool option would be to use PECL's xdiff w/ the db  
content ...

Table it w/ created_at, updated_at, content

http://us2.php.net/manual/en/function.xdiff-string-diff.php

Haven't had a chance to check it out but would be able to show  
changes over time.

- Jon

On Jun 27, 2007, at 6:47 PM, Steve Francia wrote:

> If it is just for a single document you can do it pretty easily  
> with just
> sql (mysql).
>
> Make a document table and a version table.
> The document table would have the shell of what a document was  
> (title, etc).
>
> The version table would have the document_id, content and the  
> mod_date and
> author_id.
>
> To get a document just do a join on the most recent version. All  
> the other
> solutions would require support outside of the application, which  
> could
> cause scalability problems down the road.
>
>
> On 6/27/07, Jon Baer <jonbaer at jonbaer.com> wrote:
>>
>> Subversion and WebSVN :-)
>>
>> http://websvn.tigris.org/
>>
>> On Jun 27, 2007, at 12:43 PM, David Krings wrote:
>>
>> Jake McGraw wrote:
>>
>> Hi All, this is my first post, so if this is in the wrong section
>> please let me know.
>> I'd like to know if anyone has developed a database schema for  
>> storing
>> the revision history for a plain text document by multiple users.
>> Basically, I'm talking about a wiki, but something much more simple.
>> Any suggestions on methods of organizing the information using SQL
>> (specifically MySQL) would be much appreciated.
>> Thanks!
>> - jake
>>
>>
>> I'd just keep individual copies of the text files in the file  
>> system and
>> then use a db table to keep track of the file location and their
>> chronological sequence using a UNIX time stamp. Can't think of any  
>> easier
>> way to do it.
>>
>> David
>>
>> _______________________________________________
>> New York PHP Community Talk Mailing List
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
>> NYPHPCon 2006 Presentations Online
>> http://www.nyphpcon.com
>>
>> Show Your Participation in New York PHP
>> http://www.nyphp.org/show_participation.php
>>
>>
>>
>> _______________________________________________
>> New York PHP Community Talk Mailing List
>> http://lists.nyphp.org/mailman/listinfo/talk
>>
>> NYPHPCon 2006 Presentations Online
>> http://www.nyphpcon.com
>>
>> Show Your Participation in New York PHP
>> http://www.nyphp.org/show_participation.php
>>
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20070627/19338e94/attachment.html>


More information about the talk mailing list