jonom / silverstripe-focuspoint

Module for improving automatic image cropping in SilverStripe. Adds simple art-direction control by allowing you to set and crop from a focus point instead of the centre point of an image.
MIT License
109 stars 48 forks source link

Fix v2-v3 migration task throwing SQL error #81

Closed matt-in-a-hat closed 4 years ago

matt-in-a-hat commented 4 years ago

It seems that the table name shouldn't be prepended to the column in a DROP COLUMN call.

The error I was getting was

ERROR [Emergency]: Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query:

ALTER TABLE "Image" DROP COLUMN "Image"."FocusX"

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '."FocusX"' at line 1

Using MySQL version 8.0.17 I have not tested on earlier versions.

jonom commented 4 years ago

"matt-in-a-hat" 😄 I love it.

Thanks for your contribution. While reviewing this I also noticed that this task is only operating on the base table, so I'll patch that in a moment to make sure it migrates the Live and Versions table as well.

jonom commented 4 years ago

Have tagged 3.1.3 release