-
Can i define default values, such as the following #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Deserialize, Serialize)]
#[sea_orm(table_name = "user")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(default="123")]
pub name: String,
#[sea_orm(default=num_factory)]
pub num: u8,
}
fn num_factory() -> u8 {
1
} |
Beta Was this translation helpful? Give feedback.
Answered by
billy1624
Dec 10, 2021
Replies: 1 comment
-
Hey @mxp-xc, you mean the default value of |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mxp-xc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @mxp-xc, you mean the default value of
ActiveModel
?