Skip to content

Commit

Permalink
[SHPWR-131] Remove deprecated RatePAY additional order attributes on …
Browse files Browse the repository at this point in the history
…update
  • Loading branch information
rpWelschlau committed Aug 31, 2016
1 parent 62ddd6b commit fd48c54
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public function update($version)

$this->_incrementalTableUpdate();

$this->_dropOrderAdditionalAttributes();

return array(
'success' => true,
'invalidateCache' => array(
Expand All @@ -167,6 +169,22 @@ public function update($version)
);
}

/**
* drops additional attributes for ratepay orders in s_order_attributes
*/
public function _dropOrderAdditionalAttributes()
{
Shopware()->Models()->removeAttribute('s_order_attributes','RatePAY','ShopId');
Shopware()->Models()->removeAttribute('s_order_attributes','RatePAY','TransactionId');
Shopware()->Models()->removeAttribute('s_order_attributes','RatePAY','DgNumber');

$metaDataCache = Shopware()->Models()->getConfiguration()->getMetadataCacheImpl();
$metaDataCache->deleteAll();
Shopware()->Models()->generateAttributeModels(
array('s_order_attributes')
);
}

/**
* Starts incremental update/alter queries in case of update
*
Expand Down

0 comments on commit fd48c54

Please sign in to comment.