Edgewall Software

Changes between Version 3 and Version 4 of TracDev/ScratchPad/DataModels


Ignore:
Timestamp:
Sep 2, 2016, 2:16:47 AM (8 years ago)
Author:
Ryan J Ollos
Comment:

Document changes in #11018.

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/ScratchPad/DataModels

    v3 v4  
    99=== Standardize missing values
    1010
    11 For tickets, when a field is unset, we currently put the value back to the empty string. This was not always the case, as we used to reset it to `None` / `NULL` which is still what we do in some situations (retargeting tickets to no milestone after a milestone delete/close). See #7691 and #11018.
    12 
    13 We should standardize on `NULL` again. When retrieving `NULL` values from the database, we get `None` in Python. If needed, we can carry on this distinct meaning yet manipulate it as a string by converting `None` to the special value [apidoc:api/trac_util_text#trac.util.text.empty empty]. See e.g. what we do for  [source:trunk/trac/ticket/model.py@11111:127,137#L110 ticket fields].
     11For tickets, when a field is unset or set to an empty string the database value it set to `None` / `NULL` (#11018). When retrieving `NULL` values from the database, we get `None` in Python, and the empty string is returned from the model using the special value [apidoc:api/trac_util_text#trac.util.text.empty empty]. See e.g. what we do for  [source:trunk/trac/ticket/model.py@11111:127,137#L110 ticket fields]. The pattern could be extended to other model classes, and even the `Ticket` model should be reviewed to ensure that all fields follow the pattern.
    1412
    1513=== `NOT NULL` columns