Database Migration Template
A template for planning and executing database schema changes including new tables, column modifications, data migrations, index optimization, and rollback procedures.
Template Preview
Copy and use in your projectDatabase: [Add/Modify/Remove] [table/column] for [feature]
As a developer, I want the database schema updated to support [feature] so that the application can store and query the new data efficiently without affecting existing functionality.
Description
Acceptance Criteria
Given the Prisma schema has been updated with the new changes
When I run `npx prisma db push` against the development database
Then the migration applies successfully without errors and the schema matches the expected state
Given there is existing data in the affected tables
When the migration runs
Then existing data is preserved and new columns have appropriate default values or are backfilled correctly
Given the migration has been applied
When the application runs its queries against the updated schema
Then all existing features continue to work correctly and new queries for the feature return expected results
Given the migration has been applied to staging
When I run the full test suite
Then all tests pass and no regressions are detected in related functionality
Import directly into Codepylot
Skip the copy-paste. Codepylot has built-in templates you can use with one click, plus AI that generates even richer stories from your ideas.
Try Codepylot Free