Create initial type orm database migration#866
Open
Habibah371 wants to merge 2 commits into
Open
Conversation
add environment variable validation with Joi in opsce module
Create-initial-TypeORM-database-migration
|
@Habibah371 is attempting to deploy a commit to the naijabuz's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Habibah371 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! 🚀 |
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.
[BE-33] Create Initial TypeORM Database Migration Infrastructure for OpsCE
Summary
This PR introduces the initial TypeORM migration setup for the OpsCE module and replaces automatic schema synchronization with a migration-driven workflow. The change establishes a safer and more maintainable database management process suitable for staging and production environments.
Problem
The application currently relies on
synchronize: truewithin the TypeORM configuration. While convenient during development, automatic schema synchronization can introduce unintended database changes and data integrity risks in non-local environments.Additionally, the project lacks migration files, making schema changes difficult to track, review, version, and roll back.
Changes Implemented
Database Configuration
backend/src/opsce/database/dataSource.tsfor TypeORM CLI operations.synchronize: false.Migration Tooling
Added migration management scripts to
backend/package.json:migration:generatemigration:runmigration:revertInitial Schema Migration
Testing & Verification
npm run migration:runsuccessfully creates the complete database schema.npm run migration:revertsuccessfully rolls back the latest migration.Benefits
Acceptance Criteria
backend/src/opsce/database/dataSource.tscreated for TypeORM CLI usagesynchronize: falseconfigured in AppModulebackend/package.jsonnpm run migration:runapplies the schema successfullynpm run migration:revertrolls back the latest migration successfullyCloses [BE-33] Create initial TypeORM database migration files in opsce module #758