use sea_orm_migration::prelude::*;

#[derive(DeriveMigrationName)]
pub struct Migration;

#[derive(DeriveIden)]
enum BlogArticles {
    Table,
}
#[derive(DeriveIden)]
enum SitePages {
    Table,
}

#[async_trait::async_trait]
impl MigrationTrait for Migration {
    async fn up(&self, m: &SchemaManager) -> Result<(), DbErr> {
        m.drop_table(Table::drop().table(BlogArticles::Table).if_exists().to_owned())
            .await?;
        m.drop_table(Table::drop().table(SitePages::Table).if_exists().to_owned())
            .await?;
        Ok(())
    }

    async fn down(&self, _m: &SchemaManager) -> Result<(), DbErr> {
        // The blog and static-pages domains have been retired.
        Ok(())
    }
}
