Th0mC Next Illuminate\Database\QueryException: SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP FOREIGN KEY flpoll_options_poll_id_foreign; check that it exists (SQL: alter table flpoll_options drop foreign key flpoll_options_poll_id_foreign) in /xxx/forum/vendor/illuminate/database/Connection.php:664
I had the same error despite correct migration process. This key was named poll_options_poll_id_foreign
(without table prefix) in my case.
And that is because Laravel geniuses decided to change the way how key names are build - they contain prefixes since 5.7.7 (patch release!): https://github.com/laravel/framework/pull/25867 . So depending on timing when migration from reflar/polls
were executed, key name may be different...
I'm not sure how to deal with that on extension level. But if you control your instance, you may use phpmyadmin and rename FK to contain table prefix in its names. Something like (replace flarum_
with your prefix):
ALTER TABLE `flarum_poll_options` DROP FOREIGN KEY `poll_options_poll_id_foreign`
ALTER TABLE `flarum_poll_options` ADD CONSTRAINT `flarum_poll_options_poll_id_foreign` FOREIGN KEY (`poll_id`) REFERENCES `flarum_polls`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
ALTER TABLE `flarum_poll_votes` DROP FOREIGN KEY `poll_votes_option_id_foreign`;
ALTER TABLE `flarum_poll_votes` ADD CONSTRAINT `flarum_poll_votes_option_id_foreign` FOREIGN KEY (`option_id`) REFERENCES `flarum_poll_options`(`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;