Skip to content
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

[RSN-23] - Create constraints #11

Merged
merged 7 commits into from
May 7, 2024
Merged

[RSN-23] - Create constraints #11

merged 7 commits into from
May 7, 2024

Conversation

rogacky11
Copy link
Collaborator

Description

I have created constraints for individual rows which are checking if added value's format is correct.

Related issue and/or ticket

RSN-23

@rogacky11 rogacky11 added scope: database Indicates that PR relates to database changes. type: feature PR's categorised as feature. labels Apr 9, 2024
@raczu raczu requested review from raczu and wzarek April 9, 2024 15:47
@raczu raczu self-assigned this Apr 10, 2024
@wzarek wzarek added status: require changes Determines that PR requires changes to be approved. status: ready for review Determines that PR is ready for review. and removed status: require changes Determines that PR requires changes to be approved. labels Apr 10, 2024
Copy link
Collaborator

@raczu raczu left a comment

Choose a reason for hiding this comment

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

@wzarek please verify that I didn't miss something.

Database/init-constraints.sql Outdated Show resolved Hide resolved
Database/init-constraints.sql Outdated Show resolved Hide resolved
Database/init-constraints.sql Outdated Show resolved Hide resolved
Database/init-constraints.sql Outdated Show resolved Hide resolved
Database/init-constraints.sql Outdated Show resolved Hide resolved
Database/init-constraints.sql Outdated Show resolved Hide resolved
@wzarek wzarek added status: require changes Determines that PR requires changes to be approved. and removed status: ready for review Determines that PR is ready for review. labels Apr 11, 2024
Database/init-constraints.sql Outdated Show resolved Hide resolved
@wzarek wzarek added status: ready for review Determines that PR is ready for review. and removed status: require changes Determines that PR requires changes to be approved. labels Apr 17, 2024
@rogacky11 rogacky11 requested review from raczu and wzarek April 23, 2024 19:23
Copy link
Owner

@wzarek wzarek left a comment

Choose a reason for hiding this comment

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

To check:

  • events.participant: combination of event_id and user_id should be unique, we can even do it as primary key I think
  • common.status: status name should be unique
  • events.tag: tag name should be unique
  • events.parameter: combination of key, value should be unique I think (to discuss)
  • users.role: role name should be unique
  • common.object_type: object type name should be unique
  • common.image: we should check that object of type user have max of 1 image

Also please merge main into your branch before merging, it will be easier to resolve conflicts on your computer than on github just before merging.

Database/init-db.sql Outdated Show resolved Hide resolved
Database/init-db.sql Outdated Show resolved Hide resolved
@wzarek wzarek added status: require changes Determines that PR requires changes to be approved. and removed status: ready for review Determines that PR is ready for review. labels Apr 23, 2024
@rogacky11
Copy link
Collaborator Author

To check:

* events.participant: combination of event_id and user_id should be unique, we can even do it as primary key I think

* common.status: status name should be unique

* events.tag: tag name should be unique

* events.parameter: combination of key, value should be unique I think (to discuss)

* users.role: role name should be unique

* common.object_type: object type name should be unique

* common.image: we should check that object of type user have max of 1 image

Also please merge main into your branch before merging, it will be easier to resolve conflicts on your computer than on github just before merging.

Every unique value mentioned here has been added. Furthermore to resolve problem with common.image and adding max 1 image for user, I have created unique index for object_type_id and object_id connection when object_type_id = 2 (it's user's obj_type_id)

@rogacky11 rogacky11 requested a review from wzarek April 29, 2024 11:51
@wzarek wzarek added status: ready for review Determines that PR is ready for review. and removed status: require changes Determines that PR requires changes to be approved. labels Apr 29, 2024
@wzarek wzarek assigned rogacky11 and unassigned raczu Apr 29, 2024
@wzarek wzarek added status: require changes Determines that PR requires changes to be approved. status: ready for review Determines that PR is ready for review. and removed status: ready for review Determines that PR is ready for review. status: require changes Determines that PR requires changes to be approved. labels May 4, 2024
Copy link
Collaborator

@raczu raczu left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Owner

@wzarek wzarek left a comment

Choose a reason for hiding this comment

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

OK

@wzarek
Copy link
Owner

wzarek commented May 6, 2024

@rogacky11 please rebase before merging and do squash and merge then.

@wzarek wzarek changed the title RSN-23 Create constraints [RSN-23] - Create constraints May 6, 2024
@rogacky11 rogacky11 merged commit ba4eaa4 into main May 7, 2024
6 of 7 checks passed
@wzarek wzarek deleted the RSN-23 branch May 8, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: database Indicates that PR relates to database changes. status: ready for review Determines that PR is ready for review. type: feature PR's categorised as feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants