use crate::{DateTimeUtc, RepoId};
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "pull_request_commit")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub repo: RepoId,
    #[sea_orm(primary_key)]
    pub number: i64,
    #[sea_orm(primary_key)]
    pub commit: String,
    pub message: String,
    pub author_name: String,
    pub author_email: String,
    pub authored_at: DateTimeUtc,
    pub committer_name: String,
    pub committer_email: String,
    pub committed_at: DateTimeUtc,
    pub created_at: DateTimeUtc,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}
