//! Schema migration fetch execution helpers.
//!
//! This module owns direct execution of migration-table queries and row
//! mapping, isolated from general catalog relation/column fetch logic.
use sqlx::postgres::PgPool;
use super::service_contracts::SchemaMigrationRecord;
use super::service_queries::migrations_query;
use super::service_row_mapper::map_migration_rows;
/// Fetches Supabase-style migrations when the table exists.
pub async fn fetch_migrations(pool: &PgPool) -> Result<Vec<SchemaMigrationRecord>, sqlx::Error> {
let rows = sqlx::query(migrations_query()).fetch_all(pool).await?;
Ok(map_migration_rows(rows))
}