···11+[package]
22+name = "migration"
33+version = "0.1.0"
44+edition = "2021"
55+publish = false
66+77+[lib]
88+name = "migration"
99+path = "src/lib.rs"
1010+1111+[dependencies]
1212+async-std = { version = "1", features = ["attributes", "tokio1"] }
1313+1414+[dependencies.sea-orm-migration]
1515+version = "1.1.0"
1616+features = [
1717+ # Enable at least one `ASYNC_RUNTIME` and `DATABASE_DRIVER` feature if you want to run migration via CLI.
1818+ # View the list of supported features at https://www.sea-ql.org/SeaORM/docs/install-and-config/database-and-async-runtime.
1919+ # e.g.
2020+ # "runtime-tokio-rustls", # `ASYNC_RUNTIME` feature
2121+ # "sqlx-postgres", # `DATABASE_DRIVER` feature
2222+]
+41
crates/db/migration/README.md
···11+# Running Migrator CLI
22+33+- Generate a new migration file
44+ ```sh
55+ cargo run -- generate MIGRATION_NAME
66+ ```
77+- Apply all pending migrations
88+ ```sh
99+ cargo run
1010+ ```
1111+ ```sh
1212+ cargo run -- up
1313+ ```
1414+- Apply first 10 pending migrations
1515+ ```sh
1616+ cargo run -- up -n 10
1717+ ```
1818+- Rollback last applied migrations
1919+ ```sh
2020+ cargo run -- down
2121+ ```
2222+- Rollback last 10 applied migrations
2323+ ```sh
2424+ cargo run -- down -n 10
2525+ ```
2626+- Drop all tables from the database, then reapply all migrations
2727+ ```sh
2828+ cargo run -- fresh
2929+ ```
3030+- Rollback all applied migrations, then reapply all migrations
3131+ ```sh
3232+ cargo run -- refresh
3333+ ```
3434+- Rollback all applied migrations
3535+ ```sh
3636+ cargo run -- reset
3737+ ```
3838+- Check the status of all migrations
3939+ ```sh
4040+ cargo run -- status
4141+ ```