0

Installing Magento 2.3, I get error Invalid Index, the error points to the attached code in the setup file and error states the index is

'tinyint(1) NOT NULL default 0'

. Dropped back to 2.2.7, it works fine.

if(!$installer->getConnection()->tableColumnExists($installer->getTable('catalog_product_option'),  'customoptions_status')) { 
$installer->getConnection()->addColumn( $installer->getTable('catalog_product_option'),  
                'customoptions_status',  
                'tinyint(1) NOT NULL default 0'
);
}
1
  • You should use based data type from Db Class instead of other data type SQL supported.
    – HoangHieu
    Commented Dec 25, 2018 at 6:29

1 Answer 1

2

the 'tinyint' will not work in Magento 2.3 because it is bug in magento latest version, so you must need to change "tinyint" to "int".

Also please check this post for more information about TINYTEXT, TINYINT, ENUM and MEDIUMINT : Cannot process definition to array for type tinytext on Magento 2.3.0

Please check and let me know if any issue.

5
  • Changing to int did not fix issue ..... tried another chunk of code that tried to add a column of varchar, still got the error ... [ERROR] Exception: Notice: Undefined index: varchar(10) NOT NULL default ''
    – V. Long
    Commented Dec 26, 2018 at 1:53
  • are you doing upgrade or fresh install ? Commented Dec 26, 2018 at 4:54
  • fresh install ..... works in 2.2.7.
    – V. Long
    Commented Dec 27, 2018 at 1:15
  • What is your php and mysql version ? Commented Dec 27, 2018 at 5:04
  • PHP 7.2.13 MariaDB 10.1.37 (using Windows)
    – V. Long
    Commented Dec 27, 2018 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.