Skip to content

Commit

Permalink
Update DeriveActiveEnum doc (#2345)
Browse files Browse the repository at this point in the history
* Update DeriveActiveEnum doc

* One more line

* CHANGELOG

---------

Co-authored-by: Billy Chan <[email protected]>
  • Loading branch information
gandous and billy1624 authored Oct 4, 2024
1 parent bfd21e9 commit 61516e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### House keeping

* Fix typos https://github.com/SeaQL/sea-orm/pull/2360
* Update documentations https://github.com/SeaQL/sea-orm/pull/2345

## 1.0.1 - 2024-08-26

Expand Down
2 changes: 1 addition & 1 deletion sea-orm-macros/src/derives/entity_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub fn expand_derive_entity_model(data: Data, attrs: Vec<Attribute>) -> syn::Res

let mut enum_name = None;
let mut is_primary_key = false;
// search for #[sea_orm(primary_key, auto_increment = false, column_type = "String(Some(255))", default_value = "new user", default_expr = "gen_random_uuid()", column_name = "name", enum_name = "Name", nullable, indexed, unique)]
// search for #[sea_orm(primary_key, auto_increment = false, column_type = "String(StringLen::N(255))", default_value = "new user", default_expr = "gen_random_uuid()", column_name = "name", enum_name = "Name", nullable, indexed, unique)]
for attr in field.attrs.iter() {
if !attr.path().is_ident("sea_orm") {
continue;
Expand Down
4 changes: 2 additions & 2 deletions sea-orm-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,11 @@ pub fn derive_active_model_behavior(input: TokenStream) -> TokenStream {
/// - Possible values: `String`, `i8`, `i16`, `i32`, `i64`, `u8`, `u16`, `u32`, `u64`
/// - Note that value has to be passed as string, i.e. `rs_type = "i8"`
/// - `db_type`: Define `ColumnType` returned by `ActiveEnum::db_type()`
/// - Possible values: all available enum variants of `ColumnType`, e.g. `String(None)`, `String(Some(1))`, `Integer`
/// - Possible values: all available enum variants of `ColumnType`, e.g. `String(StringLen::None)`, `String(StringLen::N(1))`, `Integer`
/// - Note that value has to be passed as string, i.e. `db_type = "Integer"`
/// - `enum_name`: Define `String` returned by `ActiveEnum::name()`
/// - This attribute is optional with default value being the name of enum in camel-case
/// - Note that value has to be passed as string, i.e. `db_type = "Integer"`
/// - Note that value has to be passed as string, i.e. `enum_name = "MyEnum"`
///
/// - For enum variant
/// - `string_value` or `num_value`:
Expand Down

0 comments on commit 61516e1

Please sign in to comment.