use sea_orm::entity::prelude::*; use time::OffsetDateTime; use uuid::Uuid; #[sea_orm::model] #[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)] #[sea_orm(table_name = "git_commit")] pub struct Model { #[sea_orm(primary_key, auto_increment = false)] pub repo_id: Uuid, #[sea_orm(primary_key, auto_increment = false)] pub sha: String, pub message: String, pub author_id: Option, pub author_name: String, pub author_email: String, pub authored_at: OffsetDateTime, pub committer_name: String, pub committer_email: String, pub committed_at: OffsetDateTime, pub created_at: OffsetDateTime, #[sea_orm(belongs_to, from = "repo_id", to = "id")] pub repo: BelongsTo, #[sea_orm(belongs_to, from = "author_id", to = "uid")] pub author: BelongsTo>, } impl ActiveModelBehavior for ActiveModel {}