How to add a column to a database table?

Use the addColumn() method of the \Magento\Framework\DB\Adapter\AdapterInterface:

A usage example from the core:

By default the \Magento\Framework\DB\Adapter\AdapterInterface interface is implemented by the \Magento\Framework\DB\Adapter\Pdo\Mysql class:

See also:

1 Like