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
#[default] needs to be added to any mandatory fields added after the initial migration.
Currently this isnt enforced. I expect the place to issue the warning or error is in make-migration.
IMO it should be a warning (initially, at least) as having no default is only critical when updating existing data - while that is an important feature, the majority of database column additions occur before the schema is in production.
Perhaps before it is enforced, there are alternatives, such as using the Default trait as a fallback. Another way to achieve that is to support #[serde(default)]https://serde.rs/attr-default.html , which avoids developing our own syntax when one already exists that should be sufficient, and then perhaps adding #[butane(default)] if there are some database specific "default" behaviours that are needed.
The text was updated successfully, but these errors were encountered:
#[default]
needs to be added to any mandatory fields added after the initial migration.Currently this isnt enforced. I expect the place to issue the warning or error is in make-migration.
IMO it should be a warning (initially, at least) as having no default is only critical when updating existing data - while that is an important feature, the majority of database column additions occur before the schema is in production.
Perhaps before it is enforced, there are alternatives, such as using the
Default
trait as a fallback. Another way to achieve that is to support#[serde(default)]
https://serde.rs/attr-default.html , which avoids developing our own syntax when one already exists that should be sufficient, and then perhaps adding#[butane(default)]
if there are some database specific "default" behaviours that are needed.The text was updated successfully, but these errors were encountered: