sea-orm-codegen 2.0.0-rc.41

Code Generator for SeaORM
Documentation
use sea_orm::entity::prelude::*;

#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "bills")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i32,
    pub self_id: Option<i32> ,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
    #[sea_orm(
        belongs_to = "Entity",
        from = "Column::SelfId",
        to = "Column::Id",
    )]
    SelfRef,
}

impl ActiveModelBehavior for ActiveModel {}