Similar to the column_exists() method, some database table upgrade routines would benefit from an easy & reliable way to check whether a database table column already has a specific index on it or not.
Easy Digital Downloads 3.0 specifically, has at least one upgrade method where a method (such as the one I'm proposing here) would be useful to avoid attempting adding an index where it already exists.
I've witnessed a single case of an upgrade loop occurring because this type of ALTER query fails, which does not bump the table version, etc...
Similar to the
column_exists()
method, some database table upgrade routines would benefit from an easy & reliable way to check whether a database table column already has a specific index on it or not.Easy Digital Downloads 3.0 specifically, has at least one upgrade method where a method (such as the one I'm proposing here) would be useful to avoid attempting adding an index where it already exists.
I've witnessed a single case of an upgrade loop occurring because this type of
ALTER
query fails, which does not bump the table version, etc...