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'
);
}
  • You should use based data type from Db Class instead of other data type SQL supported. – HoangHieu Dec 25 '18 at 6:29
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.

  • 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 Dec 26 '18 at 1:53
  • are you doing upgrade or fresh install ? – Aasim Goriya Dec 26 '18 at 4:54
  • fresh install ..... works in 2.2.7. – V. Long Dec 27 '18 at 1:15
  • What is your php and mysql version ? – Aasim Goriya Dec 27 '18 at 5:04
  • PHP 7.2.13 MariaDB 10.1.37 (using Windows) – V. Long Dec 27 '18 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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