---
title: preserveValueOnDeletion
framework: swiftdata
role: symbol
role_heading: Type Property
path: swiftdata/schema/attribute/option/preservevalueondeletion
---

# preserveValueOnDeletion

Preserves the property’s value in the persistent history when the context deletes the owning model.

## Declaration

```swift
static var preserveValueOnDeletion: Schema.Attribute.Option { get }
```

## Mentioned in

Fetching and filtering time-based model changes

## See Also

### Accessing property options

- [allowsCloudEncryption](swiftdata/schema/attribute/option/allowscloudencryption.md)
- [externalStorage](swiftdata/schema/attribute/option/externalstorage.md)
- [spotlight](swiftdata/schema/attribute/option/spotlight.md)
- [unique](swiftdata/schema/attribute/option/unique.md)
- [transformable(by:)](swiftdata/schema/attribute/option/transformable(by:)-9d4xh.md)
- [transformable(by:)](swiftdata/schema/attribute/option/transformable(by:)-lunz.md)
- [ephemeral](swiftdata/schema/attribute/option/ephemeral.md)
- [codable](swiftdata/schema/attribute/option/codable.md)
