title: Website Transactions in MySQL Database
body: <p>Good Day,</p>
  
  <p>I'm currently designing database structure for a website of mine. I need community assistance in one aspect only as I never did something similar.</p>
  
  <p>Website will include three types of the payments:</p>
  
  <ol>
  <li>Internal payments (Escrow kind payments). User can send payment to another user.</li>
  <li>Deposits. Users add fund to their accounts.</li>
  <li>Withdrawal. User can request a withdrawal. Money will be sent to their bank/PayPal account.</li>
  </ol>
  
  <p>Basically, I need some tips to get the best design possible.</p>
  
  <p>Here's what I'm thinking about:<br>
  <code>deposits</code> - this table will store info about deposits<br>
  <code>deposits_data</code> - this table will store info about deposit transaction (ex. data returned by PayPal IPN)<br>
  <code>payments</code> - table to store internal payments<br>
  <code>withdrawals</code> - table to store info about withdrawal request<br>
  <code>transactions</code> - table to store info about ALL transactions (with ENUM() field called type with following values possible: internal, deposit, withdrawal)  </p>
  
  <p>Please note that I have already a table <code>logs</code> to store every user action.</p>
  
  <p>Unfortunately, I feel that my design approch is not the best possible in this aspect. Can you share some ideas/tips?</p>
  
  <p>PS. Can I use a name "escrow" for internal payments or should I choose different name?</p>
  
  <p><strong>Edit</strong><br>
  <code>DEPOSITS</code>, <code>PAYMENTS</code> and <code>WITHDRAWALS</code> tables store specific transaction details. <code>TRANSACTIONS</code> table stores only limited info - it's a kind of logs table - with a <code>details</code> field (which contains a text to display in user log section, ex: "User 1 sent you a payment for something")/</p>
  
  <p>Of course I have users tables, etc.</p>