Changes between Version 2 and Version 3 of TracDev/ScratchPad/DataModels
- Timestamp:
- Sep 2, 2016, 12:31:20 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/ScratchPad/DataModels
v2 v3 13 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]. 14 14 15 === `NOT NULL` columns 16 17 Validation of the ticket summary is done in the [browser:tags/trac-1.0.12/trac/ticket/web_ui.py@:1247-1250#L1246 IRequestHandler], to avoid creating a ticket with an empty summary. The schema could be changed to use `NOT NULL` in the column specification since the empty string is [browser:tags/trac-1.0.12/trac/ticket/model.py#L372 replaced with NULL]. Alternatively, a `TracError` could be raised in the `Ticket` model when `insert`ing or `update`ing a ticket with an empty summary (#12458). 18 15 19 === Class methods 16 20