use actix_web::{HttpRequest, Responder, get, web::Data};
use crate::AppState;
use super::super::catalog_migration_response::schema_migrations_response;
use super::super::schema_backend::require_schema_backend;
#[get("/schema/migrations")]
pub(in super::super) async fn schema_migrations(
req: HttpRequest,
app_state: Data<AppState>,
) -> impl Responder {
let backend = match require_schema_backend(&req, app_state.get_ref()).await {
Ok(backend) => backend,
Err(resp) => return resp,
};
schema_migrations_response(&backend, app_state.get_ref()).await
}