* Update examples sea-orm version * Update example sea-schema version * Update [cli] sea-schema version * Fix [cli] cargo publish failed * Update CHANGELOG * Edit rocket example * Poem example with migration * Axum example with migration * Refactoring * Actix4 example with migration * Actix example with migration * Use sea_schema::migration::prelude
19 lines
486 B
Rust
19 lines
486 B
Rust
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Deserialize, Serialize)]
|
|
#[sea_orm(table_name = "posts")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
#[serde(skip_deserializing)]
|
|
pub id: i32,
|
|
pub title: String,
|
|
#[sea_orm(column_type = "Text")]
|
|
pub text: String,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|