doc: use npx commands for typeorm

This commit is contained in:
Xymorot 2021-07-18 16:06:18 +02:00
parent 4bb6e5c166
commit dc68771232
1 changed files with 3 additions and 3 deletions

View File

@ -127,13 +127,13 @@ The application uses [SQLite3](https://www.npmjs.com/package/better-sqlite3) as
Migrations are stored in [src/main/migrations](src/main/migrations) and handled by typeorm. Migrations are run on first database connection inside [database.ts](src/main/core/database.ts).
To auto-generate a migration:
`node_modules/.bin/typeorm migration:generate -n <migration name> -c <connection name>`
`npx typeorm migration:generate -n <migration name> -c <connection name>`
To create an empty creation which can be filled with custom migration code:
`node_modules/.bin/typeorm migration:create -n <migration name> -c <connection name>`
`npx typeorm migration:create -n <migration name> -c <connection name>`
To run migrations:
`node_modules/.bin/typeorm migration:run -c <connection name>`
`npx typeorm migration:run -c <connection name>`
This is also pre-defined in the npm script `typeorm:migrate`.
For now you need to `npm rebuild` better-sqlite3 for your local node version to run these since there is no easy way to make them work inside electron. Don't forget to run `npm run rebuild` after to rebuild for electron again.