:sparkles feat(migrations): scaffold compass migrations#1034
Merged
victor-enogwe merged 3 commits intomainfrom Oct 1, 2025
Merged
:sparkles feat(migrations): scaffold compass migrations#1034victor-enogwe merged 3 commits intomainfrom
victor-enogwe merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces database migrations and seeders functionality to Compass, providing a structured approach to manage database schema changes and data population. The implementation uses the Umzug library to handle migration execution and state tracking.
- Adds CLI commands for running migrations and seeders with proper command-line interface
- Implements a reusable migration framework with templates and MongoDB storage
- Creates a seeder for user events with interactive prompts and safety checks
Reviewed Changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/scripts/src/seeders/2025.10.01T10.09.22.seed-user-events.ts | Sample seeder implementation for creating user events with interactive prompts |
| packages/scripts/src/common/migrator-template.ts | Template class for generating new migration files |
| packages/scripts/src/common/cli.types.ts | Type definitions for migration context and migrator types |
| packages/scripts/src/commands/migrate.ts | Core migration engine using Umzug with MongoDB storage |
| packages/scripts/src/cli.ts | Updated CLI to support new migrate and seed commands |
| packages/scripts/package.json | Added umzug dependency |
| packages/backend/src/user/queries/user.queries.ts | Enhanced user query to support database sessions |
packages/scripts/src/seeders/2025.10.01T10.09.22.seed-user-events.ts
Outdated
Show resolved
Hide resolved
packages/scripts/src/seeders/2025.10.01T10.09.22.seed-user-events.ts
Outdated
Show resolved
Hide resolved
8de8bb9 to
f4e585c
Compare
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.
What does this PR do?
This PR adds the ability to generate and run database migrations and seeders to Compass. It updates the Compass cli to support the following commands:
yarn cli seed- existing command updatedyarn cli migrate- new migration commandUse Case
closes #782
How can this be manually tested?
Run the commands above in your terminal.
you can run the commads with an extra
--helpflag to see the available sub-commands