I must add column1 to sales_order_grid
and create foreign key to
table sales_grid.column1
When i try use bin/magento setup:upgrade
i get next message
Table [myPrefix]_sales_order do not have column with name "name1"
In fact, the column exists and I do not confuse names and uppercases
module.xml
<module name="Vendor_ModuleName">
<sequence>
<module name="Magento_Backend"/>
<module name="Magento_Ui"/>
</sequence>
</module>
db_schema.xml
<table name="sales_order_grid">
<column xsi:type="boolean" name="name"/>
<constraint xsi:type="foreign" referenceId="SALES_ORDER_GRID_NAME_SALES_ORDER_NAME" table="sales_order_grid" column="name" referenceTable="sales_order" referenceColumn="nameRef" onDelete="CASCADE"/>
</table>
di.xml
<virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid" type="Magento\Sales\Model\ResourceModel\Grid">
<arguments>
<argument name="columns" xsi:type="array">
<item name="name" xsi:type="string">sales_order.label_Name</item>
</argument>
</arguments>
</virtualType>
other info:
docker images:
- mariaDB - mariadb:10.4
- nginx - markoshust/magento-nginx:1.18-7
- php-fpm - markoshust/magento-php:7.3-fpm-12