If you want just to rename a column: How to rename a database column?
The difference between the
CHANGE COLUMN and
MODIFY COLUMN MySQL expressions is explained here: http://stackoverflow.com/a/22858945
- If you need to rename a column then use the
- If you need not rename the column then use the
Usage examples from the core:
See also: The
\Magento\Quote\Setup\UpgradeSchema::upgrade() method can be simplified by using the
modifyColumn() instead of
changeColumn() method of the
\Magento\Framework\DB\Adapter\AdapterInterface because the column need not be renamed.