Mysql 安装程序sql不';编译器被禁用时是否运行?

Mysql 安装程序sql不';编译器被禁用时是否运行?,mysql,sql,magento,collections,magento-collection,Mysql,Sql,Magento,Collections,Magento Collection,我的问题是指CMS magento。我已经创建了一个脚本sql安装程序,在我的服务器上,当我访问mysql并搜索时,我找不到用脚本创建的新列。 我的代码是: <?php $installer = new Mage_Sales_Model_Resource_Setup('core_setup'); //entities for options in table Sales Flat Order Item $entities = array( 'order_item' ); /

我的问题是指CMS magento。我已经创建了一个脚本sql安装程序,在我的服务器上,当我访问mysql并搜索时,我找不到用脚本创建的新列。 我的代码是:

<?php 

$installer = new Mage_Sales_Model_Resource_Setup('core_setup');

//entities for options in table Sales Flat Order Item
$entities = array(
    'order_item'
);

//entity for desactivate_count in table Sales Flat Order
$entitydes = array(
    'order'
);

//for type text
$optionstxt = array(
    'type'     => 'text',
    'grid' => false
);

//for type int
$optionsint = array(
    'type' => 'int',
    'grid' => false,
    'default' => '0'
    );

//just for column incomm_desactivate_count
$optionsdesc = array(
    'type' => 'int',
    'grid' => true,
    'default' => '0'
    );

foreach ($entities as $entity) {
    $installer->addAttribute($entity, 'incomm_request_active_code', $options);
    $installer->addAttribute($entity, 'incomm_cancel', $options);
    $installer->addAttribute($entity, 'incomm_exception_count', $optionsint); //value int(2)
    $installer->addAttribute($entity, 'incomm_return_active_code', $options);
    $installer->addAttribute($entity, 'incomm_activated', $optionsint); //value int(1)
}

foreach ($entitydes as $entity) {
    $installer->addAttribute($entity, 'incomm_desactivate_count', $optionsdesc); //value int(2)
}

$installer->endSetup();

运行升级脚本不需要编译。事实上,我认为您可能需要暂时关闭编译来运行升级脚本(不过我对此不太确定)

这取决于模块版本的值,该值存储在Magento数据库的core_resource表中

[您的模块]

config.xml  [configuraton-file] - The version number resides in this.

sql (folder) > *.php [upgrade php scripts]
现在,Magento在以下情况下运行模块中的升级脚本(两者均为真):

  • config.xml中模块的版本号大于“核心资源”模块中模块的版本号

  • config.xml文件中声明的具有新版本的脚本位于模块的sql文件夹中。Magento在文件命名约定方面非常独特

  • 我认为core_资源表中模块的版本号已经是最新版本,因此它没有搜索任何升级脚本。 因此,我建议您删除模块的条目或减少Magento db的core_资源表中的版本号。然后按照Mageto标准维护文件,升级脚本将运行