OFFLINE-GmbH / oc-snipcartshop-plugin

Ecommerce solution for October CMS using snipcart.com as a backend
MIT License
11 stars 4 forks source link

Can't uninstall plugin #10

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello,

I was trying to uninstall this plugin after testing it, but I can't. When I uninstall it, i got a popup error that prevent me to finish uninstall :

"There is no column with name 'properties' on table 'offline_snipcartshop_products'." on line 86 of /www/vendor/doctrine/dbal/lib/Doctrine/DBAL/Schema/SchemaException.php

Any help would be appreciated, can't uninstall plugin properly ATM.

Thanks

Alex

tobias-kuendig commented 7 years ago

It looks like you are using SQLite. When using SQLite Laravel down migrations often fail when more than one column is dropped. You can edit plugins/offline/snipcartshop/updates/builder_table_update_offline_snipcartshop_products.php and replace the down method with the following code:

    public function down()
    {
        Schema::table('offline_snipcartshop_products', function (Blueprint $table) {
            $table->dropColumn(['properties', 'links']);
        });
    }

Does this work for you?

ghost commented 7 years ago

Hello,

Your solution works, thanks. Does it mean that Laravel doesn't support SQLite well ?

tobias-kuendig commented 7 years ago

The problem occurs only when you try to remove two columns in one down migration by calling dropColumn twice. The migrations for this plugin were auto generated by the builder plugin so I did not catch the problem myself.

I don't remember the exact reason for it but by passing an array to dropColumn it works with SQLite as well. I will release the updated migration with the next version.