#Is there a Reason why E-Mails must be unique?

1 messages · Page 1 of 1 (latest)

analog flame
#

Hi,
I wanted to ask, if there is a reason why e-mails need to be unique?
Customers could use an email for their wife to buy something and for them self.
Would something break, if I would set "isUnique" in the database to false?

rocky mural
#

Don't think so but please do it in UI

CC: @frozen pumice

frozen pumice
#

Hello there, I can't remember if we allow toggling the isUnique constraint on standard fields

#

You will definitly need to pass through the whole API, a manual db toggle won't work

#

As there's a lot of side effects

#

Does not seem to be doable natively, input is disabled
Can't remember the consensus on this one @dapper wadi or @velvet sedge might have more information about this

analog flame
#

Thanks, could you maybe give me an example call how I could do it? or can I copy an call from another object? and do you plan to allow to change the standard fields in the Gui?

frozen pumice
# analog flame Thanks, could you maybe give me an example call how I could do it? or can I copy...

After some investigation the isUnique toggle on standard field should be available by the end of next week

export const FLAT_FIELD_METADATA_EDITABLE_PROPERTIES = {
  custom: [
    'defaultValue',
    'description',
    'icon',
    'isActive',
    'isLabelSyncedWithName',
    'isUnique',
    'label',
    'name',
    'options',
    'settings',
  ],
  standard: [
    'defaultValue',
    'description',
    'icon',
    'isActive',
    'label',
    'options',
    'settings',
    //TODO :  uncomment once universal identifier on standard fields is migrated
    // 'isUnique', // not editable for standard fields with standard unique constraint
  ],
} as const satisfies Record<'standard' | 'custom', (keyof FlatFieldMetadata)[]>;

it's currently buggy but will be fixed by https://github.com/twentyhq/twenty/pull/16893 release

GitHub

Introduction
Do not merge until IS_WORKSPACE_CREATION_V2_ENABLED has been activated by default, and so sync metadata has been deprecated by doing so. As the sync metadata will attempt to insert nul...

#

Even passing by the API won't be authorized for the moment, you will face a validation error

#

As a workaround you can still create a custom non unique field

#

Will ping you once this has been delivered for self hosters

analog flame
#

thanks a lot, I can wait another week

analog flame
#

Hi @frozen pumice , I installed now 1.15 and it's still not editable. Is it correct?

frozen pumice
#

Hey Fendle, yes not handled yet

analog flame
#

thanks

analog flame
#

Hi @frozen pumice , should it be now possible? It's in 1.16 still deactivated and I can't change it