# 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:** 3

<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 5, 2022, 4:39pm UTC](https://forum.mautic.org/t/errors-after-running-schema-update-foreign-key-constraint/25286/3 "2022-09-05T16:39:25Z")

</div>

Thanks for the response @mzagmajster

Before I do anything in Mautic I always run these in this order - learnt this in my earliest upgrade hells:

```auto
php bin/console doctrine:migration:migrate
php bin/console doctrine:schema:update --force
php bin/console cache:clear

```

I always get `No migrations to execute.` on the first command.

I always get a foreign key constraint error on the second and have mostly ignored these until now, because it didn’t seem to cause any problems.

I now want to fix this, because now I do have problems with [failing imports related to foreign key constraints](https://forum.mautic.org/t/csv-imports-fail-stalling-in-progress-runtime-less-than-1-second/25199).

As pointed out in my previous post, I am not the only one who has run into this issue and am pretty sure it has nothing to do with me not running `migrate` enough.

> I would avoid any upgrades until you resolve the issues with migration.

How can I resolve the issues?

---

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