# Strange SQL Error when trying to create new custom field

**URL:** <https://forum.mautic.org/t/strange-sql-error-when-trying-to-create-new-custom-field/22135>\
**Category:** Product Support\
**Created:** [December 23, 2021, 9:39am UTC](https://forum.mautic.org/t/strange-sql-error-when-trying-to-create-new-custom-field/22135 "2021-12-23T09:39:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [December 23, 2021, 9:39am UTC](https://forum.mautic.org/t/strange-sql-error-when-trying-to-create-new-custom-field/22135/1 "2021-12-23T09:39:15Z")

</div>

**Your software**  
My Mautic version is: 4.1.0  
My PHP version is: 7.4  
My Database type and version is: mariadb 10.3

**Your problem**  
My problem is:  
I am unable to create new custom fields, I know one issue is it is telling me sometimes that I have reached my limit and now I am getting an error

These errors are showing in the log:

```auto
[2021-12-23 09:13:21] mautic.WARNING: An exception occurred while executing 'ALTER TABLE leads ADD newtest VARCHAR(255) DEFAULT NULL': SQLSTATE[42S22]: Column not found: 1054 Unknown column '`mautic`.`l`.`email`' in 'GENERATED ALWAYS' [] []
[2021-12-23 09:13:34] mautic.WARNING: An exception occurred while executing 'ALTER TABLE leads ADD newtest VARCHAR(255) DEFAULT NULL': SQLSTATE[42S22]: Column not found: 1054 Unknown column '`mautic`.`l`.`email`' in 'GENERATED ALWAYS' [] []

```

Steps I have tried to fix the problem:  
Nothing yet

---

<div class="post-metadata">

**Author:** ![pjrobertson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pjrobertson/32/2073_2.png) [@pjrobertson](https://forum.mautic.org/u/pjrobertson)\
**Post date:** [May 20, 2022, 8:52am UTC](https://forum.mautic.org/t/strange-sql-error-when-trying-to-create-new-custom-field/22135/2 "2022-05-20T08:52:03Z")

</div>

I am also experiencing this issue with Mautic 4.2.2

Here’s my error when trying to create a select-multiple custom field:

```auto
 An exception occurred while executing 'ALTER TABLE leads ADD vol_type VARCHAR(255) DEFAULT NULL': SQLSTATE[42S22]: Column not found: 1054 Unknown column '`XXXXX`.`l`.`email`' in 'GENERATED ALWAYS' 

```

---

<div class="post-metadata">

**Author:** ![pjrobertson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pjrobertson/32/2073_2.png) [@pjrobertson](https://forum.mautic.org/u/pjrobertson)\
**Post date:** [May 20, 2022, 9:15am UTC](https://forum.mautic.org/t/strange-sql-error-when-trying-to-create-new-custom-field/22135/3 "2022-05-20T09:15:28Z")

</div>

For other googlers, I found a solution here: [Cannot Create New Custom Fields. SQLSTATE[42S22] Error - #11 by mikew](https://forum.mautic.org/t/cannot-create-new-custom-fields-sqlstate-42s22-error/23961/11)

1. Run `alter table leads drop column generated_email_domain`
2. Re-run migrations: `php bin/console doctrine:migration:migrate`
