# Error when Baking a model

**URL:** <https://discourse.cakephp.org/t/error-when-baking-a-model/12819>\
**Category:** Uncategorized\
**Created:** [March 28, 2026, 8:22am UTC](https://discourse.cakephp.org/t/error-when-baking-a-model/12819 "2026-03-28T08:22:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)\
**Post date:** [March 28, 2026, 8:22am UTC](https://discourse.cakephp.org/t/error-when-baking-a-model/12819/1 "2026-03-28T08:22:05Z")

</div>

I´m, trying to move my “localhost” Websites from a remote Linux to my Mac.

Now, when I bake a model in a new table i get this error:

> 2026-03-28 08:15:40 error: [TypeError] Cake\Database\Schema\TableSchema::getConstraint(): Argument #1 ($name) must be of type string, int given,

What does it mean?

edit:

i have a field “creator” in my table. When adding a foreign key constraint in phpmyadmin I get the above mentioned error

---

<div class="post-metadata">

**Author:** ![dereuromark](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dereuromark/32/37_2.png) [@dereuromark](https://discourse.cakephp.org/u/dereuromark)\
**Post date:** [March 28, 2026, 11:41am UTC](https://discourse.cakephp.org/t/error-when-baking-a-model/12819/2 "2026-03-28T11:41:02Z")

</div>

What version are you using? Specifically Cake core?  
This has been fixed in 5.3.0, so make sure you have the latest version running.

---

<div class="post-metadata">

**Author:** ![dirk](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/dirk/32/2174_2.png) [@dirk](https://discourse.cakephp.org/u/dirk)\
**Post date:** [March 30, 2026, 11:15am UTC](https://discourse.cakephp.org/t/error-when-baking-a-model/12819/3 "2026-03-30T11:15:07Z")

</div>

Thank you for your help!
