#[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.
#[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.