tango-core 0.3.0

The tango schema, entities, migrations, and search contract
Documentation
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

/// Per-cue transcript rows: the click-to-seek half.
///
/// Deliberately *not* deduplicated. Rolling ASR captions repeat the same
/// phrase across consecutive cues, and keeping that repetition is what lets
/// every search hit map to an exact `start_ms`. The deduplicated prose lives in
/// `video_transcript_documents` instead.
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "video_transcripts")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub video_id: String,
    #[sea_orm(primary_key, auto_increment = false)]
    pub lang: String,
    /// 'manual' or 'auto'. Part of the key, so a video can carry both.
    #[sea_orm(primary_key, auto_increment = false)]
    pub source: String,
    #[sea_orm(primary_key, auto_increment = false)]
    pub cue_index: i32,
    pub start_ms: i32,
    pub end_ms: i32,
    pub content: String,
    /// `GENERATED ALWAYS AS to_tsvector(...) STORED`, so PostgreSQL maintains
    /// it and it must never appear in an insert.
    #[sea_orm(ignore)]
    pub tsv: String,
    pub updated_at: DateTimeWithTimeZone,
}

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

impl ActiveModelBehavior for ActiveModel {}