Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Jan 28, 2022
1 parent 036939e commit 603b0ef
Showing 1 changed file with 44 additions and 1 deletion.
45 changes: 44 additions & 1 deletion sea-orm-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Getting Help:
cargo run -- -h
```

Running Entity Generator:
## Running Entity Generator:

```sh
# MySQL (`--database-schema` option is ignored)
Expand All @@ -18,3 +18,46 @@ cargo run -- generate entity -u sqlite://bakery.db -o out
# PostgreSQL
cargo run -- generate entity -u postgres://sea:sea@localhost/bakery -s public -o out
```

## Running Migration:

- Initialize migration directory
```sh
cargo run -- migrate init
```
- Apply all pending migrations
```sh
cargo run -- migrate
```
```sh
cargo run -- migrate up
```
- Apply first 10 pending migrations
```sh
cargo run -- migrate up -n 10
```
- Rollback last applied migrations
```sh
cargo run -- migrate down
```
- Rollback last 10 applied migrations
```sh
cargo run -- migrate down -n 10
```
- Drop all tables from the database, then reapply all migrations
```sh
cargo run -- migrate fresh
```
- Rollback all applied migrations, then reapply all migrations
```sh
cargo run -- migrate refresh
```
- Rollback all applied migrations
```sh
cargo run -- migrate reset
```
- Check the status of all migrations
```sh
cargo run -- migrate status
```

0 comments on commit 603b0ef

Please sign in to comment.