Further troubleshooting... I tried upgrading this same working ST 7.8.x installation to 8.6.x on another server (Server 2003, IIS 6.0, MySQL 5.5.11, the original server in question is Server 2016 Essentials, IIS 10, MySQL 5.7.x) and essentially got the same error message when SmarterTrack 8.6.x's database upgrade wizard ran:
Error executing the following:
Error on rename of '.\smartertrack_bts\st_timelogs' to '.\smartertrack_bts\#sql2-112c-11' (errno: 152)
Problem: Error on rename of '.\smartertrack_bts\st_timelogs' to '.\smartertrack_bts\#sql2-112c-11' (errno: 152)
I checked the database's last foreign key error (using MySQL command SHOW ENGINE INNODB STATUS;) and it again indicates that erroneous table:
------------------------
LATEST FOREIGN KEY ERROR
------------------------
161117 17:35:39 Error in dropping of a foreign key constraint of table "smartertrack_bts"."st_timelogs",
in SQL command
ALTER TABLE st_TimeLogs
DROP FOREIGN KEY `FK_st_TimeLogs_st_TimeLogCategories`
Cannot find a constraint with the given id "FK_st_TimeLogs_st_TimeLogCategories".
InnoDB: Renaming table `smartertrack_bts`.`st_timelogs` to `smartertrack_bts`.<result 2 when explaining filename '#sql2-112c-11'> failed!
Please advise