Skip to content

Commit

Permalink
Make custom objects soft deletable by default (#6768)
Browse files Browse the repository at this point in the history
Fixes #6766
  • Loading branch information
ijreilly authored and charlesBochet committed Aug 31, 2024
1 parent 7df5f91 commit 96d659c
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,20 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
workspaceId: objectMetadataInput.workspaceId,
defaultValue: 'now',
},
{
standardId: BASE_OBJECT_STANDARD_FIELD_IDS.deletedAt,
type: FieldMetadataType.DATE_TIME,
name: 'deletedAt',
label: 'Deleted at',
icon: 'IconCalendarClock',
description: 'Deletion date',
isNullable: true,
isActive: true,
isCustom: false,
isSystem: false,
workspaceId: objectMetadataInput.workspaceId,
defaultValue: null,
},
{
standardId: CUSTOM_OBJECT_STANDARD_FIELD_IDS.createdBy,
type: FieldMetadataType.ACTOR,
Expand Down Expand Up @@ -342,7 +356,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
);

createdObjectMetadata.fields.map(async (field, index) => {
if (field.name === 'id') {
if (field.name === 'id' || field.name === 'deletedAt') {
return;
}

Expand Down

0 comments on commit 96d659c

Please sign in to comment.