-
Notifications
You must be signed in to change notification settings - Fork 432
Open
Description
When adding a new attribute an existing model, sometimes we want a default for new items, while older items having a different default.
For example, adding an attribute for a new setting in a user config. We want new users to have the feature enabled, while old users defaulting to off.
Old users without the attribute in the db will get the "default" which is "off" (and then get backfilled when saved), while new users will get the new default.
This can also be achieved by explicitly setting the new value everywhere we create a new model, but easy to miss if a "default" already exists.
There should probably be 3 different options here:
- Default that is applied when reading from a DB missing that attribute (currently part of
default) - Default that is applied when writing a new item to the DB, but not explicitly giving it a value (currently
default_for_newanddefault) - Whether or not to backfill a read default when re-saving the the item (currently implicit when
defaultexists)
Metadata
Metadata
Assignees
Labels
No labels