我搞砸了一个模块,如何像新安装的一样重置它的表(不是空的,而是重置)?我不会重新安装模块,我只想重置数据库中的数据。
Magento 版本:1.6.0
我搞砸了一个模块,如何像新安装的一样重置它的表(不是空的,而是重置)?我不会重新安装模块,我只想重置数据库中的数据。
Magento 版本:1.6.0
To reset a module data, you have to delete it's resource related entry, this way magento will rerun setup script again.
Example: Let's say you want to reset the newsletter module data.
If you check
app/core/Mage/Newsletter/etc/config.etc
You can find
<resources>
<newsletter_setup>
<setup>
<module>Mage_Newsletter</module>
</setup>
</newsletter_setup>
</resources>
This means the resource name is newsletter_setup
Log in to your database, find the table core_resource, find the entry where the code = newsletter_setup delete it.
Now if you refresh the page, Magento will run the setup script again, in this case, it is
app/core/Mage/Newsletter/etc/sql/install-1.6.0.0.php