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

Use NULL's instead of Zero's #2

Open
asafo opened this issue Sep 24, 2015 · 0 comments
Open

Use NULL's instead of Zero's #2

asafo opened this issue Sep 24, 2015 · 0 comments

Comments

@asafo
Copy link

asafo commented Sep 24, 2015

All over, there is usage of 0 where it should be NULL (at least DB Schema wise), examples:

  1. Usage of course_categories->parent = 0 to symol top level category
  2. Usage of user = 0 when there is no applicable user
  3. Usage of grouping id = 0 instead on NULL (in course_modules for examaple)

This doesn't work with foreign keys, unless there would be category 0 and user with id=0,
a simplest solution, closer to the current situation, is to use NULL's when we mean 'no value'

This patch replaces the usage of 0 by use of NULL where appropriate

Dedicated branch: MOODLE_29_FOREIGNKEY_USE_NULL_4_ZERO

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

No branches or pull requests

1 participant