Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

NOISSUE - Make Username Unique #75

Merged

Conversation

rodneyosodo
Copy link
Member

What does this do?

This commit adds a new migration to the users. The migration adds a unique constraint to the "clients" table in the database. This constraint ensures that the "name" column of the "clients" table is unique.

Which issue(s) does this PR fix/relate to?

No issue

List any changes that modify/break current functionality

Make username unique

Have you included tests for your changes?

Yes

Did you document any new/modified functionality?

No

Notes

N/A

This commit adds a new migration to the users. The migration adds a unique constraint to the "clients" table in the database. This constraint ensures that the "name" column of the "clients" table is unique.
This commit adds constraints to the PostgreSQL database code for saving clients. Specifically, it ensures that the name column is not null and unique.
The code includes test cases with descriptions, client objects, and expected errors to cover scenarios such as adding clients successfully. These changes enhance the functionality and reliability of the codebase.

Signed-off-by: Rodney Osodo <[email protected]>
users/postgres/init.go Outdated Show resolved Hide resolved
This commit fixes an issue in the clients table in the PostgreSQL database. The name column is now set to NOT NULL and UNIQUE, ensuring that every client has a name and that the name is unique. This change improves data integrity and prevents any potential data inconsistencies.
Note: This commit does not include the clients_02 migration as it has been removed.

Signed-off-by: Rodney Osodo <[email protected]>
@dborovcanin dborovcanin merged commit dd3fb24 into main Nov 23, 2023
2 checks passed
@dborovcanin dborovcanin deleted the 11-23-feat_users_add_unique_constraint_to_clients_name branch November 23, 2023 12:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants