Update DeriveActiveEnum doc (#2345)
* Update DeriveActiveEnum doc * One more line * CHANGELOG --------- Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
This commit is contained in:
parent
bfd21e92e3
commit
61516e188a
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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`:
|
||||
|
Loading…
x
Reference in New Issue
Block a user