Skip to content

Use NULL's instead of Zero's #2

@asafo

Description

@asafo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions