-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fomrat and make minor changes
- Loading branch information
Showing
4 changed files
with
68 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<div align=center> | ||
|
||
<h1>db-diff</h1> | ||
|
||
</div> | ||
|
||
`db-diff` is a helper library built on top of the [Prisma](https://www.prisma.io/) CLI for auto-generating and versioning customizable database migrations (compatible with [Postgrator](https://www.npmjs.com/package/postgrator)). By default, the library auto-generates both `up` and `down migrations when you run the command. | ||
|
||
|
||
If you already have an existing Prisma schema in your project, run the following command | ||
|
||
``` | ||
npx db-diff | ||
``` | ||
|
||
Optional arguments: | ||
|
||
| Option | Arguments | Default | Description | | ||
| :----------------: | :-------: | :----------------------: | :-----------------------------------------------------------------------------------: | | ||
| `--schema` | | `./prisma/schema.prisma` | Path to your Prisma schema file. | | ||
| `--migrations-dir` | | `./migrations` | Path to your migrations directory. If the folder will be created if it doesnn't exist | | ||
| ` --up ` | | | Generate only the `up` migration only | | ||
| `--down` | | | Generate only the `down` migration only | | ||
|
||
Example usage: | ||
|
||
|
||
```bash | ||
npx db-diff --migrations-dir ./src/migrations | ||
``` | ||
|
||
Generate only the `up` migration: | ||
|
||
```bash | ||
npx db-diff --up | ||
``` | ||
|
||
Generate only the `down` migration: | ||
```bash | ||
npx db-diff --down | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters