Auto Migrations + Docker
Some checks are pending
Docker Push / docker (push) Waiting to run

This commit is contained in:
Shiroyasha 2025-01-19 17:59:44 +03:00
parent 5bcfff99a1
commit 591020f04b
Signed by: shiroyashik
GPG key ID: E4953D3940D7860A
11 changed files with 89 additions and 1 deletions

41
migration/README.md Normal file
View file

@ -0,0 +1,41 @@
# Running Migrator CLI
- Generate a new migration file
```sh
cargo run -- 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
```