You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like if you revise your schema and add a default value, then read old items that don't have that field defined .... the default values are not applied.
Currently default values are only being applied on create.
This quick patch addresses this:
diff --git a/src/Model.js b/src/Model.js
index ed1ce2c..68889ee 100644
--- a/src/Model.js
+++ b/src/Model.js
@@ -1134,7 +1134,7 @@ export class Model {
value = this.decrypt(value)
}
if (field.default !== undefined && value === undefined) {
- value = field.default
+ rec[name] = field.default
} else if (value === undefined) {
We'll test this out on production systems to ensure it doesn't break anything else.
The text was updated successfully, but these errors were encountered:
mobsense
changed the title
Not setting undefined values on read to required default valuesIssue title
Not setting undefined values on read to required default values
Jun 27, 2024
Looks like if you revise your schema and add a default value, then read old items that don't have that field defined .... the default values are not applied.
Currently default values are only being applied on create.
This quick patch addresses this:
We'll test this out on production systems to ensure it doesn't break anything else.
The text was updated successfully, but these errors were encountered: