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 Aug 31, 2024
1 parent 7df5f91 commit b688ee0
Showing 1 changed file with 16 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 @@ -300,6 +314,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
]
: // No fields for remote objects.
[],
isSoftDeletable: true,
});

const dataSourceMetadata =
Expand Down Expand Up @@ -342,7 +357,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 b688ee0

Please sign in to comment.