magento2の既存のテーブルに新しい列を追加しようとしています
<?php
namespace Vendor\Module\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
/**
 * @codeCoverageIgnore
 */
class InstallSchema implements InstallSchemaInterface
{
    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();
        $eavTable = $installer->getTable('eav_attribute');
        $columns = [
            'my_column' => [
                'type' => \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                'length' => '1',
                'nullable' => false,
                'comment' => 'Description of my column',
            ],
        ];
        $connection = $installer->getConnection();
        foreach ($columns as $name => $definition) {
            $connection->addColumn($eavTable, $name, $definition);
        }
        $installer->endSetup();
    }
}php bin / magento setup:upgrade
何も起こりません
アップデート1。
目標を明確に理解している場合、InstallSchemaは、セットアップテーブルに値がない場合にのみ実行されます。モジュールがすでにシステムにインストールされている場合-UpgradeSchemaで変更を行う必要があります。それは私のファイルが実行されなかったためです。アップグレードして必要な変更を加えるために名前を変更したとき-すべてが正しく機能し始めました