mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-27 13:46:32 +00:00
feat: teach sqlx-cli about migrate.migrations-dir
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::migrate;
|
||||
use crate::opt::ConnectOpts;
|
||||
use crate::{migrate, Config};
|
||||
use crate::opt::{ConnectOpts, MigrationSourceOpt};
|
||||
use console::style;
|
||||
use promptly::{prompt, ReadlineError};
|
||||
use sqlx::any::Any;
|
||||
@@ -44,18 +44,19 @@ pub async fn drop(connect_opts: &ConnectOpts, confirm: bool, force: bool) -> any
|
||||
}
|
||||
|
||||
pub async fn reset(
|
||||
migration_source: &str,
|
||||
config: &Config,
|
||||
migration_source: &MigrationSourceOpt,
|
||||
connect_opts: &ConnectOpts,
|
||||
confirm: bool,
|
||||
force: bool,
|
||||
) -> anyhow::Result<()> {
|
||||
drop(connect_opts, confirm, force).await?;
|
||||
setup(migration_source, connect_opts).await
|
||||
setup(config, migration_source, connect_opts).await
|
||||
}
|
||||
|
||||
pub async fn setup(migration_source: &str, connect_opts: &ConnectOpts) -> anyhow::Result<()> {
|
||||
pub async fn setup(config: &Config, migration_source: &MigrationSourceOpt, connect_opts: &ConnectOpts) -> anyhow::Result<()> {
|
||||
create(connect_opts).await?;
|
||||
migrate::run(migration_source, connect_opts, false, false, None).await
|
||||
migrate::run(config, migration_source, connect_opts, false, false, None).await
|
||||
}
|
||||
|
||||
fn ask_to_continue_drop(db_url: &str) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user