Removed a binary migration crate

This commit is contained in:
StNicolay 2023-06-11 13:00:27 +03:00
parent cc02d91c03
commit 2f2ab35b2b
Signed by: StNicolay
GPG Key ID: 9693D04DCD962B0D
5 changed files with 4 additions and 2301 deletions

71
Cargo.lock generated
View File

@ -357,42 +357,6 @@ dependencies = [
"zeroize",
]
[[package]]
name = "clap"
version = "3.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123"
dependencies = [
"bitflags 1.3.2",
"clap_derive",
"clap_lex",
"indexmap",
"once_cell",
"textwrap",
]
[[package]]
name = "clap_derive"
version = "3.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008"
dependencies = [
"heck 0.4.1",
"proc-macro-error",
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "clap_lex"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
dependencies = [
"os_str_bytes",
]
[[package]]
name = "const-oid"
version = "0.7.1"
@ -1156,9 +1120,9 @@ dependencies = [
[[package]]
name = "log"
version = "0.4.18"
version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de"
checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
[[package]]
name = "matchers"
@ -1322,12 +1286,6 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "os_str_bytes"
version = "6.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267"
[[package]]
name = "ouroboros"
version = "0.15.6"
@ -1976,22 +1934,6 @@ dependencies = [
"uuid",
]
[[package]]
name = "sea-orm-cli"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efbf34a2caf70c2e3be9bb1e674e9540f6dfd7c8f40f6f05daf3b9740e476005"
dependencies = [
"chrono",
"clap",
"dotenvy",
"regex",
"sea-schema",
"tracing",
"tracing-subscriber",
"url",
]
[[package]]
name = "sea-orm-macros"
version = "0.11.3"
@ -2012,11 +1954,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "278d3adfd0832b6ffc17d3cfbc574d3695a5c1b38814e0bc8ac238d33f3d87cf"
dependencies = [
"async-trait",
"clap",
"dotenvy",
"futures",
"sea-orm",
"sea-orm-cli",
"sea-schema",
"tracing",
"tracing-subscriber",
@ -2512,12 +2451,6 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "textwrap"
version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
[[package]]
name = "thiserror"
version = "1.0.40"

2181
migration/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -13,7 +13,5 @@ tokio = { version = "1.28.1", features = ["macros", "rt"] }
[dependencies.sea-orm-migration]
version = "0.11.3"
features = [
"runtime-tokio-rustls",
"sqlx-mysql",
]
features = ["runtime-tokio-rustls", "sqlx-mysql"]
default-features = false

View File

@ -1,41 +0,0 @@
# Running Migrator CLI
- Generate a new migration file
```sh
cargo run -- migrate generate MIGRATION_NAME
```
- Apply all pending migrations
```sh
cargo run
```
```sh
cargo run -- up
```
- Apply first 10 pending migrations
```sh
cargo run -- up -n 10
```
- Rollback last applied migrations
```sh
cargo run -- down
```
- Rollback last 10 applied migrations
```sh
cargo run -- down -n 10
```
- Drop all tables from the database, then reapply all migrations
```sh
cargo run -- fresh
```
- Rollback all applied migrations, then reapply all migrations
```sh
cargo run -- refresh
```
- Rollback all applied migrations
```sh
cargo run -- reset
```
- Check the status of all migrations
```sh
cargo run -- status
```

View File

@ -1,6 +0,0 @@
use sea_orm_migration::prelude::*;
#[tokio::main(flavor = "current_thread")]
async fn main() {
cli::run_cli(migration::Migrator).await;
}