mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-21 09:34:02 +00:00
feat: adds the setup command to the sqlx-cli
The reset command is the equivalent of `sqlx db create`, and `sqlx migrate run`.
This commit is contained in:
committed by
Austin Bonander
parent
916f1fccf2
commit
2e1658e08b
@@ -1,3 +1,4 @@
|
||||
use crate::migrate;
|
||||
use console::style;
|
||||
use dialoguer::Confirm;
|
||||
use sqlx::any::Any;
|
||||
@@ -30,3 +31,13 @@ pub async fn drop(uri: &str, confirm: bool) -> anyhow::Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn reset(uri: &str, confirm: bool) -> anyhow::Result<()> {
|
||||
drop(uri, confirm).await?;
|
||||
setup(uri).await
|
||||
}
|
||||
|
||||
pub async fn setup(uri: &str) -> anyhow::Result<()> {
|
||||
create(uri).await?;
|
||||
migrate::run(uri).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user