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

NOT NULL constraints for DB #962

Open
Tracked by #4
ethantkoenig opened this issue Feb 16, 2017 · 3 comments
Open
Tracked by #4

NOT NULL constraints for DB #962

ethantkoenig opened this issue Feb 16, 2017 · 3 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality

Comments

@ethantkoenig
Copy link
Member

ethantkoenig commented Feb 16, 2017

A lot of database fields that conceptually should always be populated do not have NOT NULL constraints. For instance, the num_stars, num_forks, num_watches, etc. fields in the repository table do not have NOT NULL constraints. This is problematic, because if those columns have null entries, increment/decrement operations will have no effect.

Is there a reason that these columns don't have NOT NULL constraints?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@andreynering
Copy link
Contributor

I think we should add NOT NULL where it makes sense.

We just have to make sure all records have values on these columns before migrate. In these cases (num_XXX), just update and set to 0 where it have NULL.

@andreynering andreynering added the type/enhancement An improvement of existing functionality label Feb 16, 2017
@lunny
Copy link
Member

lunny commented Feb 17, 2017

Yes. I think add NOT NULL is a good idea.

@lunny lunny added this to the 1.x.x milestone Feb 17, 2017
@stale
Copy link

stale bot commented Feb 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 17, 2019
@lunny lunny added issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented and removed issue/stale labels Feb 17, 2019
@lunny lunny removed this from the 1.x.x milestone Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

3 participants