Method to revert all applied migrations
See original GitHub issueIssue type:
[ ] question [ ] bug report [X] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[X] postgres
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[X] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
There are methods to run all pending migrations and undo only the last migration. It would be useful to also have a method to revert all applied migrations. I would like to use this during tests so as to apply all migrations before a test, and revert all of them after the test.
I have migrations that create TEXT SEARCH CONFIGURATIONs, for example, which are not deleted by the dropDatabase()
command. This would ensure that the database would be in a clean state and also test the down
part of migrations. The command to undo the last migration cannot be used for this since it does not return anything both when a migration was reverted and when there were no more migrations to revert.
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
@pleerock Thanks! That’s probably enough.
here is how this can be achieved right now: