How do I re-run a database migration script?
Objective: This article explains how to re-run a database migration script.
Note: Database migrations should be idempotent, therefore should be able to be run multiple times. However, re-running a database migration script should typically be for development/testing purposes only.
Prerequisites:
- You have database access in Raven Studio.
Steps:
- Open Raven Studio.
- Open the target database.
- View the Singletons collection.
- Open the
MigrationRegistry
document. - Remove the executed script log in the
scripts
array and save the document. - Re-run
pnpm run db:<database>
orpnpm run db:all
Related Articles: