migrator/migrations
folder.
migrationVersion
collection. And tries to apply every migration above this version in a sequence. Every migration
from migrator/migrations
will be called one by one, and every time it will be logged to the migrationLog
collection either with:
completed
status with updating the current versionfailed
status without updating the current versionfailed
migration and won’t apply versions above it.#.ts
file inside еру migrator/migrations
folder (with the name of the next version, that is higher than the current version)юMigration
with the #.ts
migration number and description.1.ts
, so let’s add another one. We have a collection of users
, but we need to assign some of them special rights within our app. Let’s add a new boolean field isAdmin
to the user schema.
isAdmin
upon creation with true
or false
.
But old users don’t have the field isAdmin
at all. So let’s add it.
publishEvents: false
promiseLimit
to perform changes to the collections, to avoid insufficient resources to complete operations:
migrationLog
and find your migration with the status failed
. It contains the error
and errorStack
fields.
For Kubernetes deployment, you can check the log inside its container by:
migrator_container_name
and namespace
, and then: