Your software
My PHP version is : 7.4
My MySQL/MariaDB version is: MySQL v8.0
Updating/Installing Errors
I am: Updating
Upgrading/installing via: Command Line
These errors are showing in the installer :
An exception occurred while executing ‘ALTER TABLE oauth2_accesstokens CHANGE user_id user_id INT UNSIGNED DEFAULT NULL, CHANGE client_id client_id INT UNSIGNED NOT NULL, CHANGE token token VARCHAR(191) NOT NULL, CHANGE scope scope VARCHAR(191) DEFAULT NULL’:
SQLSTATE[HY000]: General error: 3780 Referencing column ‘user_id’ and referenced column ‘id’ in foreign key constraint ‘FK_3A18CA5AA76ED395’ are incompatible.
These errors are showing in the Mautic log :
[2022-05-19 12:29:31] mautic.NOTICE: Doctrine\DBAL\Exception\DriverException: An exception occurred while executing ‘ALTER TABLE oauth2_accesstokens CHANGE user_id user_id INT UNSIGNED DEFAULT NULL, CHANGE client_id client_id INT UNSIGNED NOT NULL, CHANGE token token VARCHAR(191) NOT NULL, CHANGE scope scope VARCHAR(191) DEFAULT NULL’: SQLSTATE[HY000]: General error: 3780 Referencing column ‘user_id’ and referenced column ‘id’ in foreign key constraint ‘FK_XXXXXXXXXXXXXXXXXX’ are incompatible. (uncaught exception) at /home/thecroz/crosbyreport.com/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/
Your problem
My problem is :
Foreign key constraint error
Steps I have tried to fix the problem :
I believe I can manually edit the DB table to fix this, but I want to make sure I am interpreting the failure (and solution) right:
In TABLE oauth2_accesstokens, I need to CHANGE the user_id to: “INT UNSIGNED DEFAULT NULL,” and then CHANGE the client_id to “INT UNSIGNED NOT NULL,” and CHANGE the token to “VARCHAR(191) NOT NULL,” and CHANGE the scope to VARCHAR(191) DEFAULT NULL"
Am I interpreting the error/solution correctly?