title: SQL issue when merging two databases with foreign keys
body: <p>I have a database at a workspace A and workspace B. 
  Online there is a copy of this database which is always updated from both workspaces. 
  Also both workspaces can need to update their databases whenever the other workspace makes any changes. </p>
  
  <p>Everything is working well but my problem is this: for example there are 2 tables <code>Stock</code> and <code>Orders</code>, in <code>Orders</code> there is a column which is the <code>stock_id</code>. </p>
  
  <p>If workspace A creates a new "Stock X" with an automatically incremented "stock_id"=23 and workspace B creates a new "Stock Y" with an automatically incremented "stock_id" = 23, workspace B will add workspace A's "Stock X" and workspace B will add workspace B's "Stock Y" but each will have a different id in each database. </p>
  
  <p>The problem occurs when workspace A makes an order on stock_id=23 which is "Stock X", when this query is sent to the central database, and then sent to workspace B, it will insert the order but stock_id = 23 will refer to "Stock Y". </p>
  
  <p>I would really appreciate some help with this thanks :)</p>