initial commit
This commit is contained in:
8
backend/entity/Cargo.toml
Normal file
8
backend/entity/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "entity"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.144", features = ["derive"] }
|
||||
sea-orm = "0.9.2"
|
||||
1
backend/entity/src/lib.rs
Normal file
1
backend/entity/src/lib.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod todo;
|
||||
3
backend/entity/src/prelude.rs
Normal file
3
backend/entity/src/prelude.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
|
||||
pub use super::todo::Entity as Todo;
|
||||
28
backend/entity/src/todo.rs
Normal file
28
backend/entity/src/todo.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.2
|
||||
|
||||
use sea_orm::entity::prelude::*;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
||||
#[sea_orm(table_name = "todo")]
|
||||
pub struct Model {
|
||||
#[sea_orm(primary_key)]
|
||||
#[serde(skip_deserializing)]
|
||||
pub id: i32,
|
||||
pub title: String,
|
||||
pub description: String,
|
||||
pub done: bool,
|
||||
pub created_at: DateTimeWithTimeZone,
|
||||
pub updated_at: DateTimeWithTimeZone,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, EnumIter)]
|
||||
pub enum Relation {}
|
||||
|
||||
impl RelationTrait for Relation {
|
||||
fn def(&self) -> RelationDef {
|
||||
panic!("No RelationDef")
|
||||
}
|
||||
}
|
||||
|
||||
impl ActiveModelBehavior for ActiveModel {}
|
||||
Reference in New Issue
Block a user