|
1
|
If you get the following error after creating a new data model in your Medusa application: |
|
2
|
|
|
3
|
```bash |
|
4
|
error: Error: Cannot define field(s) "created_at,updated_at,deleted_at" as they are implicitly defined on every model |
|
5
|
``` |
|
6
|
|
|
7
|
The error may include the three fields, or only some of them, based on which fields you're trying to define in the data model. |
|
8
|
|
|
9
|
## Why this Error Occurred |
|
10
|
|
|
11
|
This error occurs because you're trying to define the `created_at`, `updated_at`, or `deleted_at` properties on a new data model. These properties are implicitly defined on every data model in Medusa and can't be redefined. |
|
12
|
|
|
13
|
--- |
|
14
|
|
|
15
|
## How to Fix it |
|
16
|
|
|
17
|
To resolve this error, remove the `created_at`, `updated_at`, and `deleted_at` properties from your data model definition. You'll still be able to use these properties in your application, but you can't redefine them in your data models. |
|
18
|
|
|
19
|
--- |
|
20
|
|
|
21
|
## Additional Resources |
|
22
|
|
|
23
|
- [Data Model's Default Properties](!docs!/learn/fundamentals/data-models/properties#data-models-default-properties) |