Skip to content

Commit

Permalink
docs[#154]: adds documentation as how to handle typeorm migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
shimisnow committed Dec 21, 2024
1 parent 7ac841f commit d115bb8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/markdown/database-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,24 @@ The TypeORM entities can be found at:

## TypeORM migrations

All migration files are at `apps/$SERVICE/src/app/database/migrations`

To automatically scan the database and the entities for changes and generate a migration

```sh
npx nx typeorm:migration:generate $SERVICE --name=MyMigration
# npx nx typeorm:migration:generate auth-service --name=MyMigration
```

To create an empty migration file with up and down functions

```sh
npx nx typeorm:migration:create $SERVICE --name=MyMigration
# npx nx typeorm:migration:create auth-service --name=MyMigration
```

To run the migrations

```sh
npx nx typeorm:migration:run $SERVICE
# npx nx typeorm:migration:run auth-service
Expand Down

0 comments on commit d115bb8

Please sign in to comment.