필자는 모듈로 필요한 새 열을 추가하려고합니다. bascailly "sales_flat_order"테이블에 3 개의 열을 만들어야합니다. 나는 이미 SQL을 추가하고 config.xml에 구성하는 PHP 스크립트를 만들었지 만 내 가게를로드하고 캐시를 청소 한 후 아무것도 변경되지 않고 미안하다. 뭔가 실종 되었다면 이것이 내 첫 번째 모듈이고 아직 메신저이다. magento에 새 테이블이나 열을 추가 할 때 새로운 기능.테이블에 새 열 만들기
내 모듈 구조는 같다 : - 지역/회사 명/Mynewmodule/SQL/invoicedocs_setup/mysql4 설치-010.php
$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn($installer->getTable('sales/order'),'magnifinance_invoice_id', array(
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'nullable' => true,
'length' => 10,
'after' => 'status', // column name to insert new column after
'comment' => 'Company Invoice ID'
))
->addColumn($installer->getTable('sales/order'),'magnifinance_invoice_url', array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => true,
'length' => 255,
'after' => 'status', // column name to insert new column after
'comment' => 'Company Invoice URL Doc'
))
->addColumn($installer->getTable('sales/order'),'magnifinance_date', array(
'type' => Varien_Db_Ddl_Table::TYPE_DATETIME,
'nullable' => true,
'after' => 'status', // column name to insert new column after
'comment' => 'Company Invoice Date'
));
$installer->endSetup();
- local/CompanyName/Mynewmodule/etc/config.xml:
<config>
<global>
<models>
<magnifinance>
<class>CompanyName_Mynewmodule_Model</class>
</magnifinance>
</models>
<resources>
<invoicedocs_setup>
<setup>
<module>CompanyName_Mynewmodule</module>
<class>Mage_Catalog_Model_Resource_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</invoicedocs_setup>
<invoicedocs_write>
<connection>
<use>core_write</use>
</connection>
</invoicedocs_write>
<invoicedocs_read>
<connection>
<use>core_read</use>
</connection>
</invoicedocs_read>
</resources>
...
을 나는 뭔가를 놓치고 있습니까?
**이 질문은 코드 기반이기 때문에 ** 여기에서 물을 수 있습니다. Magento 특정 문제가있는 Magento Board .. 더 빠른 응답을 얻을 수 있습니다. 그때까지이 스레드가 도움이됩니까? -> https://magento.stackexchange.com/questions/65553/how-to-add-new-column-to-existing-table-in-magento-programmatically – Zak