Originally posted by **wyatt-herkamp** March 1, 2024
Take the following enum. I think we should automatically use the Variant name if the string_value is not provided.
```rust
#[derive(DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "Interval")]
pub enum Intervals {
#[sea_orm(string_value = "Weekly")]
Weekly,
#[sea_orm(string_value = "BIWeekly")]
BIWeekly,
#[sea_orm(string_value = "Monthly")]
Monthly,
#[sea_orm(string_value = "Quarterly")]
Quarterly,
#[sea_orm(string_value = "Yearly")]
Yearly,
}
```
This would allow people to do
```rust
#[derive(DeriveActiveEnum)]
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "Interval")]
pub enum Intervals {
Weekly,
BIWeekly,
Monthly,
Quarterly,
Yearly,
}
```
And get the same result. I would be happy to make a PR if the developers of the project is Ok with this feature.
@tyt2y3 While I was working on this, it made sense to also have this for model structs, so i decided to add that in (will be pushing later today). Let me know if there are any arguments against that.
Discussed in https://github.com/SeaQL/sea-orm/discussions/2125