chore: add "pnpm run migrations:revert" command (#23869)

This commit is contained in:
idubnori
2025-11-14 01:12:59 +09:00
committed by GitHub
parent 4a6c50cd81
commit 2cefbf8ca3
5 changed files with 116 additions and 13 deletions

View File

@@ -12,3 +12,13 @@ pnpm run migrations:generate <migration-name>
3. Move the migration file to folder `./server/src/schema/migrations` in your code editor.
The server will automatically detect `*.ts` file changes and restart. Part of the server start-up process includes running any new migrations, so it will be applied immediately.
## Reverting a Migration
If you need to undo the most recently applied migration—for example, when developing or testing on schema changes—run:
```bash
pnpm run migrations:revert
```
This command rolls back the latest migration and brings the database schema back to its previous state.