Add automated database migration dry-run step to CI pipeline#1070
Open
EmeditWeb wants to merge 1 commit into
Open
Add automated database migration dry-run step to CI pipeline#1070EmeditWeb wants to merge 1 commit into
EmeditWeb wants to merge 1 commit into
Conversation
…afcode#840) - Add PostgreSQL service container to CI workflow - Add migration:run step to apply TypeORM migrations and fail on errors - Add migration:revert step to confirm migrations are reversible - Add migration:generate:check step to detect schema drift - Add src/config/datasource.ts for TypeORM CLI usage - Add migration scripts to package.json (migration:run, migration:revert, migration:generate, migration:generate:check) - Update CONTRIBUTING.md with migration testing instructions - Update README.md CI tables with migration stage - Update docs/migrations.md to use TypeORM 0.3.x CLI syntax
|
@EmeditWeb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Well done on the job done so far! |
Author
|
alright, I'd fix it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #840
Summary
Adds automated TypeORM migration validation to the CI pipeline to catch broken or missing migrations before deployment.
Changes
New file
src/config/datasource.ts— TypeORMDataSourceconfiguration for CLI use, withsynchronize: falseand correct migration pathsCI workflow (
.github/workflows/ci.yml)DATABASE_HOST,DATABASE_PORT, etc.)Run migrationsstep (pnpm run migration:run)Check for schema driftstep (pnpm run migration:generate:check)Revert migrationsstep (pnpm run migration:revert)Package scripts (
package.json)migration:run— run TypeORM migrations via CLImigration:revert— revert last migration via CLImigration:generate— generate a new migration via CLImigration:generate:check— detect schema drift (fails if model changes exist without a migration)Documentation
Acceptance criteria