I need to add a new column/field (total_volume
) to sales_shipment
table. I know that I can use two approaches to do this, but what is the best?
The first approach is to use the "Extension Attributes". In this way Magento generate for me the methods getVolume
and setVolume
.
The second approach is to use the "Declarative Schema". The problem is that with this approach Magento doesn't generate for me the methods getVolume
and setVolume
. I should use the magic methods (that I don't like too much). To do what I want, I think that with this approach I should extend the ShipmentInterface
and create a subclass for Shipment
Model. Is it right?
So between these two approaches, what should I use? When should I use the first and when the second approach?