Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/cartforge.co/app/code/CartForge/PrivateProductRequest/Setup/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/cartforge.co/app/code/CartForge/PrivateProductRequest/Setup/UpgradeSchema.php
<?php

namespace CartForge\PrivateProductRequest\Setup;

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

class UpgradeSchema implements UpgradeSchemaInterface
{
    public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $tableName = $setup->getTable('private_product_requests');

        $setup->startSetup();

        // Add or modify schema operations here
        if (version_compare($context->getVersion(), '1.1.0', '<')) {

            if ($setup->getConnection()->isTableExists($tableName)) {
                $setup->getConnection()->addColumn(
                    $tableName,
                    'full_name',
                    [
                        'type' => Table::TYPE_TEXT,
                        'length' => 255,
                        'nullable' => true,
                        'comment' => 'Full name'
                    ]
                );

                $setup->getConnection()->addColumn(
                    $tableName,
                    'email',
                    [
                        'type' => Table::TYPE_TEXT,
                        'length' => 255,
                        'nullable' => true,
                        'comment' => 'Email'
                    ]
                );

                $setup->getConnection()->addColumn(
                    $tableName,
                    'phone',
                    [
                        'type' => Table::TYPE_TEXT,
                        'length' => 255,
                        'nullable' => true,
                        'comment' => 'Phone'
                    ]
                );

                $setup->getConnection()->addColumn(
                    $tableName,
                    'company',
                    [
                        'type' => Table::TYPE_TEXT,
                        'length' => 255,
                        'nullable' => true,
                        'comment' => 'Company'
                    ]
                );
            }

        }

        $setup->endSetup();
    }


}

Spamworldpro Mini