mirror of
https://github.com/twentyhq/twenty.git
synced 2024-11-24 06:48:42 +03:00
fix: empty string as default value for string types (#2691)
* fix: empty string as default value for string types * Fixes --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
parent
0376d0b7e0
commit
2b597d817c
@ -36,7 +36,7 @@ export function convertFieldMetadataToColumnActions(
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: fieldMetadata.targetColumnMap.value,
|
||||
columnType: 'text',
|
||||
defaultValue: serializeDefaultValue(defaultValue?.value),
|
||||
defaultValue: serializeDefaultValue(defaultValue?.value ?? ''),
|
||||
},
|
||||
];
|
||||
}
|
||||
@ -52,7 +52,7 @@ export function convertFieldMetadataToColumnActions(
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: fieldMetadata.targetColumnMap.value,
|
||||
columnType: 'varchar',
|
||||
defaultValue: serializeDefaultValue(defaultValue?.value),
|
||||
defaultValue: serializeDefaultValue(defaultValue?.value ?? ''),
|
||||
},
|
||||
];
|
||||
}
|
||||
@ -120,13 +120,13 @@ export function convertFieldMetadataToColumnActions(
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: fieldMetadata.targetColumnMap.label,
|
||||
columnType: 'varchar',
|
||||
defaultValue: serializeDefaultValue(defaultValue?.label),
|
||||
defaultValue: serializeDefaultValue(defaultValue?.label ?? ''),
|
||||
},
|
||||
{
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: fieldMetadata.targetColumnMap.url,
|
||||
columnType: 'varchar',
|
||||
defaultValue: serializeDefaultValue(defaultValue?.url),
|
||||
defaultValue: serializeDefaultValue(defaultValue?.url ?? ''),
|
||||
},
|
||||
];
|
||||
}
|
||||
@ -146,7 +146,7 @@ export function convertFieldMetadataToColumnActions(
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: fieldMetadata.targetColumnMap.currencyCode,
|
||||
columnType: 'varchar',
|
||||
defaultValue: serializeDefaultValue(defaultValue?.currencyCode),
|
||||
defaultValue: serializeDefaultValue(defaultValue?.currencyCode ?? ''),
|
||||
},
|
||||
];
|
||||
}
|
||||
@ -159,13 +159,13 @@ export function convertFieldMetadataToColumnActions(
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: fieldMetadata.targetColumnMap.firstName,
|
||||
columnType: 'varchar',
|
||||
defaultValue: serializeDefaultValue(defaultValue?.firstName),
|
||||
defaultValue: serializeDefaultValue(defaultValue?.firstName ?? ''),
|
||||
},
|
||||
{
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
columnName: fieldMetadata.targetColumnMap.lastName,
|
||||
columnType: 'varchar',
|
||||
defaultValue: serializeDefaultValue(defaultValue?.lastName),
|
||||
defaultValue: serializeDefaultValue(defaultValue?.lastName ?? ''),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
@ -39,21 +39,25 @@ export const addCompanyTable: WorkspaceMigrationTableAction[] = [
|
||||
columnName: 'linkedinLinkUrl',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'linkedinLinkLabel',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'xLinkUrl',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'xLinkLabel',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'annualRecurringRevenueAmountMicros',
|
||||
|
@ -19,7 +19,7 @@ export const addViewFieldTable: WorkspaceMigrationTableAction[] = [
|
||||
},
|
||||
{
|
||||
columnName: 'position',
|
||||
columnType: 'integer',
|
||||
columnType: 'float',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: 0,
|
||||
},
|
||||
|
@ -22,7 +22,7 @@ export const addActivityTable: WorkspaceMigrationTableAction[] = [
|
||||
columnName: 'body',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
defaultValue: "'{}'",
|
||||
},
|
||||
{
|
||||
columnName: 'type',
|
||||
|
@ -16,6 +16,7 @@ export const addApiKeyTable: WorkspaceMigrationTableAction[] = [
|
||||
columnName: 'name',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'revokedAt',
|
||||
|
@ -28,46 +28,55 @@ export const addPersonTable: WorkspaceMigrationTableAction[] = [
|
||||
columnName: 'email',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'linkedinLinkUrl',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'linkedinLinkLabel',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'xLinkUrl',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'xLinkLabel',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'jobTitle',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'phone',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'city',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'avatarUrl',
|
||||
columnType: 'varchar',
|
||||
action: WorkspaceMigrationColumnActionType.CREATE,
|
||||
defaultValue: "''",
|
||||
},
|
||||
{
|
||||
columnName: 'companyId',
|
||||
|
Loading…
Reference in New Issue
Block a user