Can't define fields Error

If you get the following error after creating a new data model in your Medusa application:

Terminal
❯error:   Error: Cannot define field(s) "created_at,updated_at,deleted_at" as they are implicitly defined on every model

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.

Why this Error Occurred#

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.


How to Fix it#

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.


Additional Resources#

Was this page helpful?
Ask Bloom
For assistance in your development, use Claude Code Plugins or Docs MCP server in Cursor, VSCode, etc...FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break
⇧↵