Skip to content

feat!: rename user collection to users #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

tim-hm
Copy link
Collaborator

@tim-hm tim-hm commented Jun 20, 2025

No description provided.

@tim-hm tim-hm requested review from pablojhl and Copilot and removed request for pablojhl June 20, 2025 10:26
Copy link

@Copilot 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 renames the collection from "user" to "users" to improve naming consistency across the codebase. Key changes include:

  • Updating the usage of CollectionName from "User" to "Users" in repository functions.
  • Modifying the collection enum in the mongo utility file.
  • Adjusting the migration scripts to create and drop the renamed collection.

Reviewed Changes

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

File Description
src/users/users.repository.ts Updated collection references for consistency.
src/common/mongo.ts Renamed the "User" enum entry to "Users".
migrations/20250522_1000_init.ts Modified migration scripts to create and drop "Users".
Comments suppressed due to low confidence (1)

migrations/20250522_1000_init.ts:29

  • The migration script now creates a 'Users' collection, but it does not include logic to handle the renaming of an existing 'user' collection in production environments. Consider adding a migration step to rename the collection if it exists to avoid potential data loss.
          primary.createCollection(CollectionName.Users),

Copy link

github-actions bot commented Jun 20, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 85.21% 5106 / 5992
🔵 Statements 85.21% 5106 / 5992
🔵 Functions 77.31% 300 / 388
🔵 Branches 90.5% 658 / 727
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
migrations/20250522_1000_init.ts 67.3% 80% 75% 67.3% 13-14, 47-61
src/common/mongo.ts 86.48% 86.79% 81.81% 86.48% 96-97, 112-118, 124-127, 132-134, 237-243, 255-261
src/users/users.repository.ts 96.61% 93.33% 66.66% 96.61% 177-182
Generated in workflow #376 for commit 28e855c by the Vitest Coverage Report Action

@tim-hm tim-hm merged commit da17b23 into main Jun 20, 2025
3 of 4 checks passed
@tim-hm tim-hm deleted the feat/rename-user-collection-to-users branch June 20, 2025 11:01
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.

1 participant