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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      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

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10