Your software
My Mautic version is: 3.1.0
My PHP version is: 7.3.20
My MariaDB version is : 10.5
Your problem
My problem is: There are 134 Executed Unavailable Migrations
Here’s the migration status:
[root@vps mmm.mysite.com]# php bin/console cache:clear
// Clearing the cache for the prod environment with debug false
[OK] Cache for the "prod" environment (debug=false) was successfully cleared.
[root@vps mmm.mysite.com]# php bin/console doctrine:migration:status
== Configuration
>> Name: Mautic Migrations
>> Database Driver: pdo_mysql
>> Database Host: localhost
>> Database Name: mauticdb
>> Configuration Source: manually configured
>> Version Table Name: migrations
>> Version Column Name: version
>> Migrations Namespace: Mautic\Migrations
>> Migrations Directory: /var/www/mmm.mysite.com/app/migrations
>> Previous Version: 2020-08-05 18:57:14 (20200805185714)
>> Current Version: 2020-08-15 15:37:11 (20200815153711)
>> Next Version: Already at latest version
>> Latest Version: 2020-08-15 15:37:11 (20200815153711)
>> Executed Migrations: 147
>> Executed Unavailable Migrations: 134
>> Available Migrations: 13
>> New Migrations: 0
[root@vps mmm.mysite.com]#
Steps I have tried to fix the problem:
I’ve run doctrine:migration:migrate
and doctrine:schema:update
without success
[root@vps mmm.mysite.com]# php bin/console doctrine:migrations:migrate --no-interaction --env=prod --no-debug
[2020-08-28 18:08:42] Your database version (5.5.5-10.1.35-MariaDB) does not support generated columns. Upgrade at least to 10.2.6 and update `db_server_version` accordingly to get the speed improvements.
[2020-08-28 18:08:42]
[2020-08-28 18:08:42] Mautic Migrations
[2020-08-28 18:08:42]
[2020-08-28 18:08:42] WARNING! You have 134 previously executed migrations in the database that are not registered migrations.
[2020-08-28 18:08:42] >> 2015-04-02 00:00:00 (20150402000000)
[2020-08-28 18:08:42] >> 2015-05-04 00:00:00 (20150504000000)
[2020-08-28 18:08:42] >> 2015-05-21 00:00:00 (20150521000000)
[2020-08-28 18:08:42] >> 2015-07-18 00:00:00 (20150718000000)
[2020-08-28 18:08:42] >> 2015-07-24 00:00:00 (20150724000000)
[2020-08-28 18:08:42] >> 2015-08-01 00:00:00 (20150801000000)
...
...
[2020-08-28 18:08:42] >> 2018-12-04 00:00:00 (20181204000000)
[2020-08-28 18:08:42] >> 2019-07-15 06:50:13 (20190715065013)
[2020-08-28 18:08:42] No migrations to execute.
[root@vps mmm.mysite.com]# php bin/console doctrine:schema:update --force
Updating database schema...
In AbstractMySQLDriver.php line 106:
An exception occurred while executing 'ALTER TABLE oauth2_accesstokens CHANGE client_id client_id INT UNSIGNED NOT NULL, CHANGE user_id user_id INT UNSIGNED NOT NULL, CHANGE token token VARCHAR(191) NOT NULL, CHANGE expires_at expires_at BIGINT DEFAULT NULL, CHANGE s
cope scope VARCHAR(191) DEFAULT NULL':
SQLSTATE[HY000]: General error: 1832 Cannot change column 'client_id': used in a foreign key constraint 'FK_3A18CA5A19EB6921'
In PDOConnection.php line 80:
SQLSTATE[HY000]: General error: 1832 Cannot change column 'client_id': used in a foreign key constraint 'FK_3A18CA5A19EB6921'
In PDOConnection.php line 75:
SQLSTATE[HY000]: General error: 1832 Cannot change column 'client_id': used in a foreign key constraint 'FK_3A18CA5A19EB6921'
doctrine:schema:update [--complete] [--dump-sql] [-f|--force] [--em [EM]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
[root@vps mmm.mysite.com]#
Any idea on how to fix that ?
Thanks for any hint.