title: Magento Order Table: custom column
body: <p>I recently made a module that calculates the real gross margin for every order and order_item based on shipping cost data I import.  I did this by adding 2 columns to the <strong>sales_flat_order</strong> table and the <strong>sales_flat_order_item</strong> table.  This seemed to work great, until I realized that when I saved the imported data, it also updated the <strong>updated_at</strong> value.  Since this was the first import of all orders, they all now report having been updated today.  This is throwing off reports and other shipping software that syncs with it.</p>
  
  <p>This brings me to 2 questions:</p>
  
  <ol>
  <li>Is adding a column to an existing table (in this case, the sales tables) a major NO-NO?</li>
  <li>If not, is there a way to set the data that doesn't increase the <strong>updated_at</strong> value?</li>
  </ol>
  
  <p>If it helps, the code that actually writes the data is inside my <strong>IndexController.php</strong> file.  It loops through the collection of orders and the items within those orders and sets the necessary values using something like <code>$order-&gt;setGrossMargin($orderGM)-&gt;save();</code>.  I imagine it is the call to <code>save()</code> that is doing it, but I'm not sure the right way around this problem.</p>
  
  <p>In the mean time, I'm working on a solution in which I import the data to custom tables and only read from the sales tables when necessary.  Either way, it's a good exercise :)</p>
  
  <p>Brian</p>