# Errors after running schema:update - foreign key constraint

**URL:** https://forum.mautic.org/t/errors-after-running-schema-update-foreign-key-constraint/25286
**Category:** Product Support
**Created:** [September 3, 2022, 2:36pm UTC](https://forum.mautic.org/t/errors-after-running-schema-update-foreign-key-constraint/25286 "2022-09-03T14:36:27Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![modifiedcontent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/modifiedcontent/32/511_2.png) [@modifiedcontent](https://forum.mautic.org/u/modifiedcontent)
#### Post date: [September 10, 2022, 1:05pm UTC](https://forum.mautic.org/t/errors-after-running-schema-update-foreign-key-constraint/25286/10 "2022-09-10T13:05:41Z")

</div>

Starting from scratch trying to solve migrations mess, following [this advice here](https://forum.mautic.org/t/mysql-error-upgrading-to-4-2/22867/6).

A first step is to run php bin/console doctrine:migrations:migrate. I had earlier mentioned that I never have anything to migrate here, but I do get a list of stuff from 2015-2019. I always assumed these were just old archives, but scrolling up I see this message:

> WARNING! You have 134 previously executed migrations in the database that are not registered migrations.

Googling that [leads me here](https://github.com/mautic/mautic/issues/9673) where @silavapi [explains](https://github.com/mautic/mautic/issues/9673#issuecomment-786709404) ‘We had to make some decisions on how to handle old migrations and this is I believe a result of that’ - sounds solid!

Also this: ‘… we are going to be writing up some documentation on this for developers as it caused a bit of a problem for MariaDB users.’ What is the status of that? Where can I find that documentation? I am a MariaDB user. Sucks to be me?

She advices to run a database schema check when that shows up - which perhaps prompted someone else to advice to run `doctrine:schema:update --force`

If I try to update schema via the browser using `/s/update/schema` as adviced, I get `Database schema is already up-to-date`.

Should I ignore the error I get when I run `doctrine:schema:update --force`? I am still stuck with [this csv import problem that I assumed was related](https://forum.mautic.org/t/csv-imports-fail-stalling-in-progress-runtime-less-than-1-second/25199).

If that doesn’t solve the issue, rcheesley advices to look for outstanding database migrations with `php bin/console doctrine:migration:status`

This gives me the following useful looking info:

`

== Configuration

```
>> Name: Mautic Migrations
>> Database Driver: pdo_mysql
>> Database Host: localhost
>> Database Name: mymauticdb
>> Configuration Source: manually configured
>> Version Table Name: migrations
>> Version Column Name: version
>> Migrations Namespace: Mautic\Migrations
>> Migrations Directory: /home/myusername/public_html/mautic/app/migrations
>> Previous Version: 2021-06-23 07:13:26 (20210623071326)
>> Current Version: 2022-01-11 20:29:17 (20220111202917)
>> Next Version: Already at latest version
>> Latest Version: 2022-01-11 20:29:17 (20220111202917)
>> Executed Migrations: 181
>> Executed Unavailable Migrations: 134
>> Available Migrations: 47
>> New Migrations: 0

```

`

Are those 47 ‘Available Migrations’ supposed to run? When I hit ‘yes’ on `doctrine:migrations:migrate` - ignoring the WARNING at the top… - I get `No migrations to execute.` As usual, this is what I always get.

Is this an irrelevant tangent/dead-end/distraction? Moving back to [the CSV import problem thread](https://forum.mautic.org/t/csv-imports-fail-stalling-in-progress-runtime-less-than-1-second/25199/6) that lead me here…

---

_[View the full topic](https://forum.mautic.org/t/errors-after-running-schema-update-foreign-key-constraint/25286)._
