twentyhq / twenty

Building a modern alternative to Salesforce, powered by the community.
https://twenty.com
GNU Affero General Public License v3.0
15.27k stars 1.56k forks source link

Support custom field deletion for custom composite fields #4841

Closed ijreilly closed 1 week ago

ijreilly commented 3 months ago

Context

This bug was fixed by not allowing the deletion of such fields. Let's support it!

Old: _TypeORM is throwing an error due to the fact that we are asking the ORM to delete a column that does not exist. This is expected since composite fields are not simply 1:1 with the fieldMetadata but result in different columns. For example, an ADDRESS field will be mapped to multiple columns (xxx_street, xxxstate, ...).

Technical inputs

We should update the field_metadata service to handle composite fields. We can use utils such as isCompositeFieldMetadataType and CompositeFieldsDefinitionFunction to get the correct column names.

Weiko commented 3 months ago

I've added a description with technical inputs

mnbro commented 2 weeks ago

How can we manually delete these fields?