internetztube / craft-element-relations

Shows all relations of an element.
https://plugins.craftcms.com/element-relations
Other
2 stars 6 forks source link

Changes to ensure clean siteId column drop #8

Closed gbowne-quickbase closed 2 years ago

gbowne-quickbase commented 2 years ago

When I applied my changes in the previous PR, things worked, but I need to make a few changes so it would work from a clean install and on another server where the migration had stopped halfway. This safely drops the foreign key implicitly created by the index, the index itself, and then the columns if they exist.

Also, the index on relations and dateUpdated was throwing an error for MySQL users MySQL Error 1170 because an index on a text field needs a length. This seems to have handled it, but I'd love a second set of 👀 to make sure that's functioning as designed for others.

internetztube commented 2 years ago

Thank you, @gbowne-quickbase!