fix: can't create fields of type UUID (#2642)

This commit is contained in:
Jérémy M 2023-11-22 14:58:13 +01:00 committed by GitHub
parent 5c8c141556
commit 4c1c6a3407
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -14,6 +14,19 @@ export function convertFieldMetadataToColumnActions(
fieldMetadata: FieldMetadataEntity,
): WorkspaceMigrationColumnAction[] {
switch (fieldMetadata.type) {
case FieldMetadataType.UUID: {
const defaultValue =
fieldMetadata.defaultValue as FieldMetadataDefaultValue<FieldMetadataType.UUID>;
return [
{
action: WorkspaceMigrationColumnActionType.CREATE,
columnName: fieldMetadata.targetColumnMap.value,
columnType: 'uuid',
defaultValue: serializeDefaultValue(defaultValue?.value),
},
];
}
case FieldMetadataType.TEXT: {
const defaultValue =
fieldMetadata.defaultValue as FieldMetadataDefaultValue<FieldMetadataType.TEXT>;

View File

@ -19,6 +19,7 @@ export function generateTargetColumnMap(
const columnName = isCustomField ? `_${fieldName}` : fieldName;
switch (type) {
case FieldMetadataType.UUID:
case FieldMetadataType.TEXT:
case FieldMetadataType.PHONE:
case FieldMetadataType.EMAIL: