Edgewall Software

Changes between Version 20 and Version 21 of TracTicketsCustomFields


Ignore:
Timestamp:
Jan 23, 2008, 11:23:50 PM (16 years ago)
Author:
dan@…
Comment:

Add some information about updating the database directly to insert default custom ticket values

Legend:

Unmodified
Added
Removed
Modified
  • TracTicketsCustomFields

    v20 v21  
    107107Note in particular the `LEFT OUTER JOIN` statement here.
    108108
     109=== Updating the database ===
     110
     111As noted above, any tickets created before a custom field has been defined will not have a value for that field. Here's a bit of SQL (tested with SQLite) that you can run directly on the Trac database to set an initial value for custom tickt fields. Inserts the default value of 'None' into a custom field called 'request_source' for all tickets that have no existing value:
     112
     113{{{
     114#!sql
     115INSERT INTO ticket_custom
     116   (ticket, name, value)
     117   SELECT
     118      id AS ticket,
     119      'request_source' AS name,
     120      'None' AS value
     121   FROM ticket
     122   WHERE id NOT IN (
     123      SELECT ticket FROM ticket_custom
     124   );
     125}}}
     126
    109127----
    110128See also: TracTickets, TracIni