diff --git a/packages/backend/native-utils/scylla-migration/src/cli.rs b/packages/backend/native-utils/scylla-migration/src/cli.rs index ff177b015c..0832747630 100644 --- a/packages/backend/native-utils/scylla-migration/src/cli.rs +++ b/packages/backend/native-utils/scylla-migration/src/cli.rs @@ -4,6 +4,7 @@ use std::{fs, path::PathBuf}; use crate::config::Config; use crate::error::Error; use crate::migrator::Migrator; +use crate::setup::Initializer; pub async fn run_cli() -> Result<(), Error> { let cli = Cli::parse(); @@ -29,7 +30,10 @@ pub async fn run_cli() -> Result<(), Error> { match cli.subcommand { MigrationCommand::Up { num } => { - Migrator::new(migration_dir, &scylla_conf).await?.up(num).await? + Migrator::new(migration_dir, &scylla_conf) + .await? + .up(num) + .await? } MigrationCommand::Down { num } => { Migrator::new(migration_dir, &scylla_conf) @@ -37,6 +41,10 @@ pub async fn run_cli() -> Result<(), Error> { .down(num) .await? } + MigrationCommand::Setup => { + let initializer = Initializer::new(&scylla_conf, &config.db).await?; + initializer.setup().await?; + } _ => {} };