title: How to code a simple versioning system?
body: <p>I want to do a simple versioning system but i don't have ideas on how to structure my datas, and my code.</p>
  
  <p>Here is a short example:</p>
  
  <ol>
  <li>User logs in</li>
  <li>User has two options when uploading a file:
  
  <ul>
  <li>Submit a new file</li>
  <li>Submit a new version of a file</li>
  </ul></li>
  </ol>
  
  <p>Users should be able to see the tree. (the different version)
  The tree can only be up to 2 levels:</p>
  
  <pre><code>|
  |--File_A_0
   \--File_A_1
   \--File_A_2
   \--File_A_3
   \--File_A_4
  </code></pre>
  
  <p>There are also 2 types of file, a final (which is the latest approved version) and a draft version (which the latest uploaded file)
  The file will be physically stored on the server.
  Each files are owned by a user (or more) and only one group.</p>
  
  <p><strong>Edit:</strong> Groups represent a group of document, document could only be owned by ONE group at once. Users do NOT depend on groups.</p>
  
  <p><strong>Begin edit:</strong></p>
  
  <p>Here is what i did, but it is not really efficient !</p>
  
  <pre><code>id_article | relative_group_id | id_group | title | submited | date | abstract | reference | draft_version | count | status
  
  id_draft | id_file | version | date
  </code></pre>
  
  <p>But it's difficult to manage, to extend.
  I think it's because the group paramater...</p>
  
  <p><strong>End edit</strong></p>
  
  <p>So the questions are: </p>
  
  <ul>
  <li>How can i schematize my database ?</li>
  <li>What kind of infos should be usefull
  to version this work ?</li>
  <li>What kind of structure for the
  folders, files ?</li>
  <li>What kind of tips, hints do you have
  to do this kind of work ?</li>
  </ul>
  
  <p>(The application is developped with PHP and Zend Framework, database should be mysql or postgresql)</p>