However when I run an upgrade script to add this column I get this Error:
Error in file: "..................sql/test123_bannerslider_setup/upgrade-0.0.1-0.0.2.php" - SQLSTATE[42000]: Syntax error or access violation: 1142 SELECT command denied to user 'devx'@'localhost' for table 'test123_bannerslider_bannerslider'";i:1;s:1259:"#0 ..................../app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
<?php
$table = $this;
$table->startSetup();
$table->getConnection()
->addColumn(
$table->getTable('test123_bannerslider/bannerslider'),
'topheadline',
Varien_Db_Ddl_Table::TYPE_VARCHAR,
255,
array(
'nullable' => true
)
);
$this->endSetup();
My file structure:
->sql
-->test123_bannerslider_setup
--->install-0.0.1.php
--->upgrade-0.0.1-0.0.2.php
Update:
SOLUTION
Finally I change my code to SQL and now it works:
<?php
$table = $this;
$table->startSetup();
$table->run("
ALTER TABLE test123_bannerslider_bannerslider
ADD COLUMN `topheadline` VARCHAR(255) NULL;
");
$table->endSetup();