Skip to content

:sparkles feat(migrations): scaffold compass migrations#1034

Merged
victor-enogwe merged 3 commits intomainfrom
feat-init-compass-migrations-782
Oct 1, 2025
Merged

:sparkles feat(migrations): scaffold compass migrations#1034
victor-enogwe merged 3 commits intomainfrom
feat-init-compass-migrations-782

Conversation

@victor-enogwe
Copy link
Contributor

@victor-enogwe victor-enogwe commented Oct 1, 2025

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 updated
  • yarn cli migrate - new migration command

Use Case

closes #782

How can this be manually tested?

Run the commands above in your terminal.
you can run the commads with an extra --help flag to see the available sub-commands

Copilot AI review requested due to automatic review settings October 1, 2025 14:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@victor-enogwe victor-enogwe force-pushed the feat-init-compass-migrations-782 branch from 8de8bb9 to f4e585c Compare October 1, 2025 14:56
Copilot AI review requested due to automatic review settings October 1, 2025 23:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 10 changed files in this pull request and generated 3 comments.

@victor-enogwe victor-enogwe merged commit 5dfc17c into main Oct 1, 2025
4 checks passed
@victor-enogwe victor-enogwe deleted the feat-init-compass-migrations-782 branch October 1, 2025 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initialize mongo migrations using the umzug library

2 participants