Skip to content
  • totten's avatar
    CRM-20958 - Extract helper Civi\Core\SqlTrigger\TimestampTriggers · 6050e9ad
    totten authored
    == Before ==
    
     * SQL triggers to populate `civicrm_contact.created_date` and  `civicrm_contact.modified_date` are
       generate via `CRM_Contact_BAO_Contact::triggerInfo($info, $tableName)`
    
    == After ==
    
     * `CRM_Contact_BAO_Contact::triggerInfo` calls a helper `TimestampTriggers`
     * The helper `TimestampTriggers` accepts arguments describing the names of the tables/columns
       which needed for the timestamp triggers.
    
    == Comments ==
    
    To test, I used this command to update and dump the schema:
    
    ```
    cv api system.flush triggers=1 && mysqldump --triggers ...
    ```
    
    The schema was identical before and after.  (Notably, by alternately hacking
    the code, I was able to validate the test was capable of revealing
    discrepencies.)
    6050e9ad