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> {
        // Optional per-product discounted price (minor units) shown to ALL
        // business (company) accounts as a baseline, computed off the regular
        // price like the personal sale. Per-company profiles/negotiated prices
        // still layer on top (lowest price wins).
        add_column(m, "products", "business_sale_price_cents", ColType::BigIntegerNull).await
    }

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