Billy Chan 73701fef9a
Codegen Unsigned Integer - 2 (#397)
* feat: codegen unsigned integer

* feat: apply alias on `ColumnRef::SchemaTableColumn`

* Update SQLite test cases, quote identifier with double quotes

* Bump sea-query version to 0.22

* Add dummy line

* Tests [cli] and [issues]

* update sea-schema

Co-authored-by: Chris Tsang <chris.2y3@outlook.com>
2022-03-14 12:40:02 +08:00

65 lines
1.4 KiB
Rust

//! SeaORM Entity. Generated by sea-orm-codegen 0.1.0
use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "rust_keyword")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub testing: i8,
pub rust: u8,
pub keywords: i16,
pub r#type: u16,
pub r#typeof: i32,
pub crate_: u32,
pub self_: i64,
pub self_id1: u64,
pub self_id2: i32,
pub fruit_id1: i32,
pub fruit_id2: i32,
pub cake_id: i32,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "Entity",
from = "Column::SelfId1",
to = "Column::Id",
)]
SelfRef1,
#[sea_orm(
belongs_to = "Entity",
from = "Column::SelfId2",
to = "Column::Id",
)]
SelfRef2,
#[sea_orm(
belongs_to = "super::fruit::Entity",
from = "Column::FruitId1",
to = "super::fruit::Column::Id",
)]
Fruit1,
#[sea_orm(
belongs_to = "super::fruit::Entity",
from = "Column::FruitId2",
to = "super::fruit::Column::Id",
)]
Fruit2,
#[sea_orm(
belongs_to = "super::cake::Entity",
from = "Column::CakeId",
to = "super::cake::Column::Id",
)]
Cake,
}
impl Related<super::cake::Entity> for Entity {
fn to() -> RelationDef {
Relation::Cake.def()
}
}
impl ActiveModelBehavior for ActiveModel {}