إنشاء جدول جديد في الماجنتو باستخدام مشكلة التثبيت
سؤال
لقد قمت بإنشاء وحدة نمطية، ولكنني الآن بحاجة إلى إنشاء جدول في ديسيبل.هذا هو محتوى Mynamespace/Mymodule/sql/mynamespace_mymodule_setup/mysql4-install-0.1.0.php:
<?php
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
echo 1; exit();
$installer->startSetup();
$table = $installer->getConnection()
->newTable($installer->getTable('mynamespace_mymodule/mytablename'))
->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
'identity' => true,
'unsigned' => true,
'nullable' => false,
'primary' => true,
), 'Id')
->addColumn('check', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
'nullable' => false,
), 'Check')
$installer->getConnection()->createTable($table);
$installer->endSetup();
هذا هو محتوى ملف config.xml:
<config>
<modules>
<Mynamespace_Mymodule>
<version>0.1.0</version>
</Mynamespace_Mymodule>
</modules>
<global>
<models>
<mynamespace_mymodule>
<class>Mynamespace_Mymodule_Model</class>
<resourceModel>mynamespace_mymodule_mysql4</resourceModel>
</mynamespace_mymodule>
<mynamespace_mymodule_mysql4>
<class>Mynamespace_Mymodule_Model_Mysql4</class>
<entities>
<mytablename>
<table>mynamespace_mymodule_mytablename</table>
</mytablename>
</entities>
</mynamespace_mymodule_mysql4>
</models>
<resources>
<mynamespace_mymodule_setup>
<setup>
<module>Mynamespace_Mymodule</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</mynamespace_mymodule_setup>
<mynamespace_mymodule_write>
<connection>
<use>core_write</use>
</connection>
</mynamespace_mymodule_write>
<mynamespace_mymodule_read>
<connection>
<use>core_read</use>
</connection>
</mynamespace_mymodule_read>
</resources>
</global>
كما ترى فقد قمت بوضع مخرج بعد $installer.لا يذهب هناك أبدا.هناك خطأ ما في ملف xml الخاص بي.هل يمكنك مساعدتي في هذا؟شكرًا
المحلول
إذا كان هناك سجل في core_resource
مع العمود core
= 'mynamespace_mymodule_setup' لن يتم تشغيل البرامج النصية للمثبت مرة أخرى.احذف هذا السجل وامسح ذاكرة التخزين المؤقت
لا تنتمي إلى magento.stackexchange