Migrations Overview
This section contains step-by-step upgrade and migration guides for @bratsos/workflow-engine packages.
Upgrade Process
When upgrading the packages, follow this process to check for breaking changes, database schema updates, or API refactors:
Step 1: Detect Your Version Delta
Compare your currently installed version (check package.json in your node modules or use npm list @bratsos/workflow-engine) with the target upgrade version.
- Migration guides are published for minor and major version bumps (e.g.
0.7to0.8,0.13to1.0). - Patch releases (e.g.
0.10.1to0.10.2) only contain bug fixes and do not require code changes or database migrations. - The 1.0 alphas are one guide:
1.0.0-alpha.x→1.0.0-alpha.yupgrades are covered by the database checklist in the 0.13 → 1.0 guide, which is kept current with every alpha (each statement is idempotent, so re-running it is safe). npx workflow-engine-codemod --from <version>flags the removed APIs in your code with a pointer to the relevant guide.
Step 2: Build the Ordered Migration Chain
If you are upgrading across multiple minor versions (e.g., 0.7.0 to 0.10.0), you must apply the migration guides sequentially:
- Apply the
0.7to0.8migration (run database schema updates, change deprecated code). - Apply the
0.8to0.9migration. - Apply the
0.9to0.10migration.
Step 3: Run Database Migrations
If a version bump introduces a database schema change (like adding a table or modifying columns):
- Update your
prisma/schema.prismafile with the new models. - Generate and apply the migration locally:
npx prisma migrate dev --name upgrade-workflow-engine
- Regenerate the client:
npx prisma generate
Available Migration Guides
Follow the guides below to migrate your code:
- Migrating from 0.13 to 1.0 (Latest — the
1.0.0-alpha.xline, installed with the@alphatag) - Migrating from 0.12 to 0.13
- Migrating from 0.11 to 0.12
- Migrating from 0.10 to 0.11
- Migrating from 0.9 to 0.10
- Migrating from 0.8 to 0.9
- Migrating from 0.7 to 0.8