Billy Chan 08cb44028e
Support bigdecimal::BigDecimal (#1258)
* Fix: fields with type `Option<T>` are always nullable

* Support BigDecimal
2022-12-01 12:53:19 +08:00

22 lines
677 B
Rust

use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "pi")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(column_type = "Decimal(Some((11, 10)))")]
pub decimal: Decimal,
#[sea_orm(column_type = "Decimal(Some((11, 10)))")]
pub big_decimal: BigDecimal,
#[sea_orm(column_type = "Decimal(Some((11, 10)))")]
pub decimal_opt: Option<Decimal>,
#[sea_orm(column_type = "Decimal(Some((11, 10)))")]
pub big_decimal_opt: Option<BigDecimal>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {}