Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-14548

Modify the notification field in data module to be NOT NULL and to have a nice (0) default

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Database SQL/XMLDB
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      It seems that the data->notification field doesn't have one suitable default value and it has caused some problems in Moodle 1.9 (see MDL-14540 and MDL-14323).

      For 19_STABLE I fixed that by adding one default value in data_update_instance() but that isn't the definitive change, because that field will be plagued with zeros and nulls (depending of the DB).

      So, we need to definitively fix this under Moodle 2.0 (requires DB changes). The plan is:

      1) Require permission to MD about to change DB in HEAD (perhaps we are still sticky to 19_STABLE). If permission is given, continue, else, hant until HEAD DB changes are allowed.
      2) As part of the data module upgrade script:
      a) Upgrade all the data->notifications currently being NULL to 0 (zero).
      b) Modify the field to be NOT NULL
      c) Modify the field to have a DEFAULT of 0 (zero)
      (note b & c must be performed in two steps)
      3) Modify install.xml (for new installations) in order to have that field defined as NOT NULL DEFAULT 0
      4) Upgrade data module version.php to make the upgrade happen.

      All these exclusively under HEAD. As said, plz, confirm with MD if we are free to start changing DB in HEAD.

      Ciao

      Attachments

        Issue Links

          Activity

            People

              dongsheng Dongsheng Cai
              stronk7 Eloy Lafuente (stronk7)
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Nov/10