문제

I have written a small module and I've made Setup classes include InstallData, InstallSchema, UpgradeData, and UpgradeSchema and put them in Setup folder, For the first time I did run setup:upgrade command everything was ok.

A table created and some data inserted. But then I tried to edit UpgradeSchema.php and UpgradeData.php to change table schema and data, but nothing happened.

I also changed module.xml and increase setup_version to 0.0.3 or 0.0.4, but it didn't work!

I commented the "if (version_compare($context->getVersion(), '0.0.2', '<'))" condition, but nothing changed after setup:upgrade again!

Please help me what to do.

도움이 되었습니까?

해결책

I changed module.xml setup_version to 0.0.5 in UpgradeSchema.php

I changed the if clause

if (version_compare($context->getVersion(), '0.0.5', '<'))

And in setup_module table schema_version in 0.0.1. should I change the table?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top