Your IP : 216.73.216.220


Current Path : /var/www/html/app/code/FlipsDigital/EducationInstitution/Setup/
Upload File :
Current File : /var/www/html/app/code/FlipsDigital/EducationInstitution/Setup/UpgradeSchema.php

<?php
/**
 * installSchema.php
 *
 * @copyright Copyright © 2021 FlipsDigital. All rights reserved.
 * @author    calvin.so@flipsdigital.com
 */
namespace FlipsDigital\EducationInstitution\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

/**
 * @codeCoverageIgnore
 */
class UpgradeSchema implements UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {

        $tableName = EducationInstitutionSetup::ENTITY_TYPE_CODE . '_entity';
        $installer = $setup;
        $installer->startSetup();
        $connection = $installer->getConnection();

        if (version_compare($context->getVersion(), '0.0.3', '<')) {
            $connection->addColumn(
            $installer->getTable($tableName),
               'description',
               [
                   'type' => Table::TYPE_TEXT,
                   'length' => 256,
                   'nullable' => false,
                   'default' => '',
                   'comment' => 'product custom type'
               ]
           );
        }
         $installer->endSetup();
    }
}