Context: Not a lot of WP dev knowledge, but experienced PHP developer in general.
So, as everyone might know (or not, like I didn't) DigitalOcean's Managed Database system is set to have a required primary key (not globally changeable). While I understand it's better that way, sometimes when installing an existing plugin on a WordPress website, the plugin have to create tables, that may or may not have a primary key in it.
I have a list of those kind of plugins, to which I will send an improvement request where it's possible but as a workaround I would like to resolve this by making use of a hook and/or the "must-use plugin" system of WordPress to call SET SESSION sql_require_primary_key = OFF;
before every create table statement (or every sql statement in general, if there is no way to focus only on create table statements).
- Is this a "good" & feasable workaround ?
- How can I achieve this (what hook should I be calling) ?