Ignore:
Timestamp:
Aug 10, 2009, 11:23:49 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #108: Logging the change history of an item

  • Added core classes and test case.
  • Unreferenced history entries are deleted by cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/common-queries.xml

    r5021 r5039  
    34993499    </description>
    35003500  </query>
     3501  <query id="FIND_USED_TYPES_IN_CHANGEHISTORY" type="HQL">
     3502    <sql>
     3503      SELECT DISTINCT ch.itemType FROM ChangeHistoryDetailData ch
     3504    </sql>
     3505    <description>
     3506      An HQL query that selects all used item types in the change
     3507      history table.
     3508    </description>
     3509  </query>
     3510  <query id="DELETE_STRAY_CHANGEHISTORY" type="HQL">
     3511    <sql>
     3512      DELETE FROM ChangeHistoryDetailData
     3513      WHERE id IN (:ids)
     3514    </sql>
     3515    <description>
     3516      A HQL query that deletes all change history entries with the
     3517      id's given in the list.
     3518    </description>
     3519  </query>
     3520  <query id="SELECT_STRAY_CHANGEHISTORY" type="SQL">
     3521    <sql>
     3522      SELECT [ch].[id]
     3523      FROM [ChangeHistoryDetails] [ch]
     3524      LEFT JOIN [{1}] [t]
     3525        ON ([t].[id] = [ch].[item_id] AND [ch].[item_type] = :type)
     3526      WHERE [t].[id] IS NULL
     3527      AND [ch].[item_type] = :type
     3528    </sql>
     3529    <description>
     3530      An SQL query that selects the ID of all change history entries
     3531      that references a missing item of a specified type.
     3532    </description>
     3533  </query>
     3534 
    35013535</predefined-queries>
Note: See TracChangeset for help on using the changeset viewer.