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

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "repo_branch")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub repo: RepoId,
    #[sea_orm(primary_key)]
    pub name: String,
    pub oid: String,
    pub upstream: Option<String>,
    pub head: bool,
    pub created_at: DateTimeUtc,
    pub updated_at: DateTimeUtc,
}

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

impl ActiveModelBehavior for ActiveModel {}
