All we can do is delete the administrator/components/com_admintools/sql/updates/mysql/7.1.1-20220209.sql file. This removes the problem. This is tried, tested, and then tested again manually removing the file.
This is what we did in 7.4.6. The file was removed from the package and we are trying to delete it if it still exists within our post-installation code (administrator/components/com_admintools/src/Model/UpgradeModel.php).
There are, of course, two fine points.
1. Did Joomla! delete the file? Please check that for me. On my test and live sites, it does. Depending on server configuration and file and directory permissions it might not happen.
2. The finicky, utterly wrong way Joomla is going about this is to check the whole field definition returned by the MySQL database server against the exact content of the SQL file, including lower/uppercase and spaces. Have I mentioned that MySQL may return the definition of the database table column in a slightly different way when it comes to the use of spaces and lower/uppercase letters for SQL keywords? Yeah. So, no matter how exactly we write the update SQL, Joomla! will complain for some people.
Of course, if you have read so far you will have noticed that there are two trivial fixes to be made in Joomla:
1. If the same database table column is referenced in two or more SQL update files, Joomla! should only ever keep the latest one. It already determines which is the latest SQL update file using version_compare() on the filenames to write this information in the #__schemas table. Why does it not do the same when detecting "problems"? Obvious bug and obvious fix.
2. Since the database server will return the structure of the column with varying character case and spaces, it stands to reason that Joomla! could squash spaces and convert everything to lowercase before doing the comparison between what the database server returns and what's in the file, therefore sidestepping all those issues. It's literally adding this: preg_replace('#\s+#i', '', strtolower(...))
. This is also obvious to anyone who's worked with databases for more than a couple of days.
I reckon a half-competent developer could implement those fixes within half an hour. This stuff is broken for about a decade. Nobody found half an hour in this decade, do they not understand how their software works, or do they just not care? I am wondering.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!