defaultValue won't be applied for customFields
Opened this issue · 0 comments
KilianSSL commented
Describe the bug
When i define a defaultValue
for a custom field of type string
on the Product entity, it always ends up being null
in the database. For type int
it always ends up being 0, despite of what i set in the config, e.g. 101
.
To Reproduce
Steps to reproduce the behavior:
- Add custom field (type "string", with a desired
defaultValue
) in the vendure config, for entity Product - Apply migrations
- Navigate to "Product"
- Fill out required fields, already note that there is no value visible in the newly added custom field.
- Click "Create"
- In the network tab, the value for the custom field is
null
- If you check the database, the value is
null
as well.
Expected behavior
Default values behave as intended.
Environment (please complete the following information):
- @vendure/core version: 3.1.0
- Nodejs version 20.17.0
- Database (mysql/postgres etc): sqlite
Additional context
Reproduction: https://github.com/KilianSSL/vendure-custom-field-default-value