Strange error on upgrade to 8.5.7

Exception Occurred: /var/www/concrete5/updates/concrete5-8.5.7/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php:115 An exception occurred while executing 'ALTER TABLE ExpressFormFieldSetPublicIdentifierControls ADD CONSTRAINT FK_67180C04BF396750 FOREIGN KEY (id) REFERENCES ExpressFormFieldSetControls (id) ON DELETE CASCADE':

SQLSTATE[HY000]: General error: 1005 Can't create table 'intranet.#sql-2f6b_c0a168' (errno: 150) (0)

Which version are you upgrading from?

It was 8.5.2. I ended up restoring from a backup and did the incremental upgrades from 5.3 → 5.6 → 5.7.