aboutsummaryrefslogtreecommitdiffstats
path: root/lib/api-config/src/schema/delete_schema.rs
blob: 86e71d5af65fe8ae56ad021f7804c78947f986ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use tracing::debug;

use crate::{ConfigurationError, schema::SchemaService};

pub(super) async fn delete_schema(
    state: &SchemaService,
    kind: &str,
    version: &str,
) -> Result<(), ConfigurationError> {
    debug!("deleting transaction schema");
    sqlx::query!(
        "delete from transaction_schema where schema_type = $1 and schema_version = $2",
        kind,
        version,
    )
    .execute(&state.database)
    .await?;
    Ok(())
}