upgrade to sea-orm 0.12 and fix code
This commit is contained in:
parent
3dcc17b6af
commit
81cb448eb8
@ -28,17 +28,17 @@ chrono = "0.4.26"
|
|||||||
tera = "^1.19.0"
|
tera = "^1.19.0"
|
||||||
async-trait = "^0.1.68"
|
async-trait = "^0.1.68"
|
||||||
lazy_static = "^1.4.0"
|
lazy_static = "^1.4.0"
|
||||||
itertools = "^0.10.5"
|
itertools = "^0.11.0"
|
||||||
serde = "^1.0.164"
|
serde = "^1.0.164"
|
||||||
serde_derive = "^1.0.164"
|
serde_derive = "^1.0.164"
|
||||||
sea-orm = { version = "^0.11.3", features = [], default-features = false }
|
sea-orm = { version = "^0.12.2", features = [], default-features = false }
|
||||||
actix-admin-macros = { version = "0.5.0", path = "actix_admin_macros" }
|
actix-admin-macros = { version = "0.5.0", path = "actix_admin_macros" }
|
||||||
derive_more = "0.99.17"
|
derive_more = "0.99.17"
|
||||||
regex = "1.8.4"
|
regex = "1.8.4"
|
||||||
urlencoding = "2.1.2"
|
urlencoding = "2.1.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
sea-orm = { version = "^0.11.3", features = [ "sqlx-sqlite", "runtime-actix-native-tls", "macros" ], default-features = true }
|
sea-orm = { version = "^0.12.2", features = [ "sqlx-sqlite", "runtime-actix-native-tls", "macros" ], default-features = true }
|
||||||
actix-rt = "2.8.0"
|
actix-rt = "2.8.0"
|
||||||
azure_auth = { path = "./examples/azure_auth/azure_auth" }
|
azure_auth = { path = "./examples/azure_auth/azure_auth" }
|
||||||
oauth2 = "4.4.1"
|
oauth2 = "4.4.1"
|
||||||
|
@ -187,7 +187,7 @@ pub fn get_actix_admin_fields_searchable(fields: &Vec<ModelField>) -> Vec<TokenS
|
|||||||
let column_name = capitalize_first_letter(&model_field.ident.to_string());
|
let column_name = capitalize_first_letter(&model_field.ident.to_string());
|
||||||
let column_ident = Ident::new(&column_name, Span::call_site());
|
let column_ident = Ident::new(&column_name, Span::call_site());
|
||||||
quote! {
|
quote! {
|
||||||
.add(Column::#column_ident.contains(&search))
|
.add(Column::#column_ident.contains(search))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
|
@ -46,7 +46,7 @@ impl Related<super::comment::Entity> for Entity {
|
|||||||
|
|
||||||
impl ActiveModelBehavior for ActiveModel {}
|
impl ActiveModelBehavior for ActiveModel {}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
|
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveDisplay, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
|
||||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
|
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
|
||||||
pub enum Tea {
|
pub enum Tea {
|
||||||
#[sea_orm(string_value = "EverydayTea")]
|
#[sea_orm(string_value = "EverydayTea")]
|
||||||
|
@ -51,7 +51,7 @@ impl Related<super::comment::Entity> for Entity {
|
|||||||
|
|
||||||
impl ActiveModelBehavior for ActiveModel {}
|
impl ActiveModelBehavior for ActiveModel {}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
|
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveDisplay, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
|
||||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
|
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
|
||||||
pub enum Tea {
|
pub enum Tea {
|
||||||
#[sea_orm(string_value = "EverydayTea")]
|
#[sea_orm(string_value = "EverydayTea")]
|
||||||
|
@ -46,7 +46,7 @@ impl Related<super::comment::Entity> for Entity {
|
|||||||
|
|
||||||
impl ActiveModelBehavior for ActiveModel {}
|
impl ActiveModelBehavior for ActiveModel {}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
|
#[derive(Debug, Clone, PartialEq, EnumIter, DeriveDisplay, DeriveActiveEnum, Deserialize, Serialize, DeriveActixAdminEnumSelectList)]
|
||||||
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
|
#[sea_orm(rs_type = "String", db_type = "Enum", enum_name = "tea")]
|
||||||
pub enum Tea {
|
pub enum Tea {
|
||||||
#[sea_orm(string_value = "EverydayTea")]
|
#[sea_orm(string_value = "EverydayTea")]
|
||||||
|
Loading…
Reference in New Issue
Block a user