- Issue created by @redzeuf
- 🇨🇭Switzerland redzeuf Geneva
First patch to simply remove the hook_update_xxxx function.
- 🇨🇭Switzerland redzeuf Geneva
Second patch, just checking in the hook_update_xxxx if the table exist before creating it.
If the table exist we don't try to create it. - 🇬🇧United Kingdom james.williams
The update hook is for sites that had language hierarchy installed from before the schema hook existed. New installations of the module would not run the update hook. If you already had the table on installing the module, or on updating it, I imagine perhaps your database got into an unsupported state somehow? Did something interrupt its installation at some point perhaps, or reset its record of its schema / last installed version?
https://www.drupal.org/docs/drupal-apis/update-api/updating-database-sch... → is the most up-to-date documentation I can find; that shows how both of the hooks are necessary. Update hooks aren't usually designed to be safely run more than once, but of course if you got into this situation, I can understand how your fix would be necessary.
So I'm closing this issue as works as designed, but I'm happy to continue dialog here if you can provide more detailed clearly repeatable steps with a fresh install? (I just tested your steps to reproduce on simplytest.me, using the browser equivalents for running updates, and could not reproduce the error.)