use sea_orm_migration::prelude::*;
#[derive(DeriveMigrationName)]
pub struct Migration;
const UP: &str = include_str!("sql/0004_resumable_harvests.sql");
#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager.get_connection().execute_unprepared(UP).await?;
Ok(())
}
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.get_connection()
.execute_unprepared(
r#"
DROP FUNCTION IF EXISTS public.mark_videos_as_shorts(text[]);
ALTER TABLE public.channels DROP COLUMN IF EXISTS harvest_page_token;
"#,
)
.await?;
Ok(())
}
}