reversible migrations for cli

- adds a -r flag whihc will create a reversible migration
- add revert subcommand, which reverts the last migration
- add --dry-run flag to migration run command, which list the migrations that will be applied
- updates add migration to check if all migration are of same type, i.e cannot mix and match reversible and simple migrations
This commit is contained in:
sid
2020-08-22 23:58:07 +05:30
committed by Ryan Leckey
parent 70fa667063
commit f41551f3ad
14 changed files with 331 additions and 21 deletions

View File

@@ -40,5 +40,5 @@ pub async fn reset(migration_source: &str, uri: &str, confirm: bool) -> anyhow::
pub async fn setup(migration_source: &str, uri: &str) -> anyhow::Result<()> {
create(uri).await?;
migrate::run(migration_source, uri).await
migrate::run(migration_source, uri, false).await
}