0

For upgrade database, I use direct SQL such as belove code

 $setup->run("delete from directory_country_region");

            $setup->run("TRUNCATE directory_country_region");

            $setup->run("delete from directory_country_region_city");

            $setup->run("TRUNCATE directory_country_region_city");

but just last query was executed.

0

i do like this ... i do not know why it is worked but it's worked

    $setup->startSetup();

    $setup->run("delete from directory_country_region_city");
    $setup->startSetup();

    $setup->run("TRUNCATE directory_country_region_city");
    $setup->startSetup();


    $setup->run("delete from directory_country_region_name");
    $setup->startSetup();

    $setup->run("TRUNCATE directory_country_region_name");
0

You must use method chaining to run multiple queries when doing schema setup. Like this:

$installer->startSetup();
$installer->run("delete from directory_country_region_city")
->run("TRUNCATE directory_country_region_city")
->run("delete from directory_country_region_name");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.