use loco_rs::schema::*;
use sea_orm_migration::prelude::*;

#[derive(DeriveMigrationName)]
pub struct Migration;

#[async_trait::async_trait]
impl MigrationTrait for Migration {
    async fn up(&self, m: &SchemaManager) -> Result<(), DbErr> {
        // A short blurb shown on product cards (grid/list), distinct from the full
        // `description` rendered on the product detail page.
        add_column(m, "products", "short_description", ColType::TextNull).await
    }

    async fn down(&self, m: &SchemaManager) -> Result<(), DbErr> {
        remove_column(m, "products", "short_description").await
    }
}
