//! SeaORM migration: add commit_sha and blob_hash to project_skill

use sea_orm_migration::prelude::*;

pub struct Migration;

impl MigrationName for Migration {
    fn name(&self) -> &str {
        "m20260413_000001_add_skill_commit_blob"
    }
}

#[async_trait::async_trait]
impl MigrationTrait for Migration {
    async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
        let sql = include_str!("sql/m20260413_000001_add_skill_commit_blob.sql");
        super::execute_sql(manager, sql).await
    }

    async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
        super::execute_sql(manager, "ALTER TABLE project_skill DROP COLUMN IF EXISTS commit_sha, DROP COLUMN IF EXISTS blob_hash;").await
    }
}
