I've created a custom order attribute in my extension's setup script like this:
$setup->addAttribute('order', 'my_custom_attribute', array(
'type' => 'varchar',
'input' => 'text',
'label' => 'My Custom Attribute',
'global' => 0,
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'default' => '',
'visible_on_front' => 0,
));
When I look into eav_attribute table in the DB after running this script I can see that a new entry has been created with the options listed above and assigned to the entity_type_id of 4, which is the sales/order entity model in this installation.
Now when I do the following, I get an empty result:
$order = Mage::getModel('sales/order')->load(90);
$order->setData('my_custom_attribute', 'test');
$order->save();
$order = Mage::getModel('sales/order')->load(90);
echo $order->getData('my_custom_attribute'); // NULL
Is there a step that I'm missing here?