feat: add accountName field to User model with unique constraint#2083
Open
feat: add accountName field to User model with unique constraint#2083
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an accountName field to the User model to provide an auto-generated unique identifier for each user account. The field is optional and automatically populated during user creation if not provided.
- Added
accountNamefield to the User model in Prisma schemas with unique constraint - Created database migration files for SQLite and PostgreSQL
- Implemented
generateAccountName()function to auto-generate account names with the prefix 'acn'
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/db-main-prisma/prisma/template.prisma | Added optional accountName field with unique constraint to User model |
| packages/db-main-prisma/prisma/sqlite/schema.prisma | Added accountName field to SQLite-specific User schema |
| packages/db-main-prisma/prisma/sqlite/migrations/20251105051541_add_users_account_name/migration.sql | SQLite migration to add account_name column and unique index |
| packages/db-main-prisma/prisma/postgres/schema.prisma | Added accountName field to PostgreSQL-specific User schema |
| packages/db-main-prisma/prisma/postgres/migrations/20251105051609_add_users_account_name/migration.sql | PostgreSQL migration to add account_name column and unique index |
| packages/core/src/utils/id-generator.ts | Added AccountName prefix and generateAccountName() function |
| apps/nestjs-backend/src/features/user/user.service.ts | Modified user creation to auto-generate accountName if not provided |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
511ba59 to
c39b885
Compare
boris-w
approved these changes
Nov 5, 2025
c39b885 to
178a666
Compare
91a82ee to
bee1fe2
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.
No description provided.