docs: update migration guide to deal with typeorm hanging on reverts

This seems to be a common occurrence with attempted migrations between different Misskey forks.

This is the best solution that I can come up with; someone who knows more bash could probably make this completely automated.
This commit is contained in:
Norm 2023-07-09 06:58:22 +00:00
parent a5080f80a1
commit 29320a751d

View file

@ -21,10 +21,12 @@ LINE_NUM="$(npx typeorm migration:show -d ormconfig.js | grep -n nsfwDetection16
NUM_MIGRATIONS="$(npx typeorm migration:show -d ormconfig.js | tail -n+"$LINE_NUM" | grep '\[X\]' | nl)" NUM_MIGRATIONS="$(npx typeorm migration:show -d ormconfig.js | tail -n+"$LINE_NUM" | grep '\[X\]' | nl)"
for i in $(seq 1 $NUM_MIGRATIONS); do for i in $(seq 1 $NUM_MIGRATIONS); do
npx typeorm migration:revert -d ormconfig.js npx typeorm migration:revert -d ormconfig.js || continue
done done
``` ```
**Note:** TypeORM might hang when reverting a migration. If it says that the migration was reverted successfully, you can force close TypeORM using Ctrl-C. The script will continue until all of the migrations have been reverted.
## Switching repositories ## Switching repositories
To switch to the FoundKey repository, do the following in your Misskey install location: To switch to the FoundKey repository, do the following in your Misskey install location:
```sh ```sh