Answers.Body: <p>It should change the structure on the log tables, but with the caveat that the log table system isn't at the same level of support and usage as the rest of CiviCRM. The beta label hasn't come off it for years, so I wouldn't be surprised to see a bug like that.</p>
  
  <p>If you're using logging, I assume you're already prepared for trouble when you upgrade, and if you are capable of changing the field structure now, I assume you'll be able to fix things later. Consequently, go ahead and make the change, but note it somewhere. If an upgrade fails, you'll know one potential reason.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-16T14:05:11.137Z
Answers.LastActivityDate: 2015-07-16T14:05:11.137Z
Answers.UserDisplayName: Andie Hunt
Answers.Body: <p>See <a href="http://forum.civicrm.org/index.php/topic,27229.msg116038.html#msg116038" rel="nofollow">Are the logging tables upgraded</a>:</p>
  
  <blockquote>
    <p>yes. you disable logging during upgrade (the upgrade changes are not
    logged)</p>
    
    <p>when u reenable logging, it checks for schema differences and makes
    the needed changes to the logging table</p>
  </blockquote>
  
  <p>Since version 4.3, logging should be automatically disabled and re-enabled during upgrades: see <a href="https://issues.civicrm.org/jira/browse/CRM-10798" rel="nofollow">Upgrade should disable logging and triggers</a>.</p>
  
  <p>This suggests the possibility that if logging remained enabled during an upgrade prior to 4.3.0, the structure of logging tables may not have been updated at that point.</p>
  
  <p>It also suggests that disabling and re-enabling logging ought to bring the logging schema up to date.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-16T14:13:33.627Z
Answers.LastActivityDate: 2015-07-16T14:13:33.627Z
Answers.UserDisplayName: davejenx
Body: <p>If a CiviCRM upgrade amends the structure of existing tables, do you know if the same changes are applied to the equivalent logging tables?</p>
  
  <p>I've noticed in the column <code>civicrm_line_item.label</code> NULL is allowed, but in <code>log_civicrm_line_item.label</code> it's not. So when I create Contribution prices without labels, I get a constraint violation from the logging trigger during payment.</p>
  
  <p>Wanted to check if it's safe to amend the logging table structure to match, or if there was a reason for the difference.</p>
  
Tags: <upgrade><database>
Title: Are log tables updated during an upgrade?
ThreadText: # Are log tables updated during an upgrade?
  
  (Asked by: username_0 on 2015-07-16)
  
  If a CiviCRM upgrade amends the structure of existing tables, do you know if the same changes are applied to the equivalent logging tables?
  
  I've noticed in the column `civicrm_line_item.label` NULL is allowed, but in `log_civicrm_line_item.label` it's not. So when I create Contribution prices without labels, I get a constraint violation from the logging trigger during payment.
  
  Wanted to check if it's safe to amend the logging table structure to match, or if there was a reason for the difference.
  
  **Tags:** upgrade, database
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-07-16. Score: 1 | Accepted answer
  
  It should change the structure on the log tables, but with the caveat that the log table system isn't at the same level of support and usage as the rest of CiviCRM. The beta label hasn't come off it for years, so I wouldn't be surprised to see a bug like that.
  
  If you're using logging, I assume you're already prepared for trouble when you upgrade, and if you are capable of changing the field structure now, I assume you'll be able to fix things later. Consequently, go ahead and make the change, but note it somewhere. If an upgrade fails, you'll know one potential reason.
  
  
  ---
  
  ### Answer by username_2 on 2015-07-16. Score: 2
  
  See [Are the logging tables upgraded](http://forum.civicrm.org/index.php/topic,27229.msg116038.html#msg116038):
  
  > yes. you disable logging during upgrade (the upgrade changes are not
  > logged)
  >
  > when u reenable logging, it checks for schema differences and makes
  > the needed changes to the logging table
  
  Since version 4.3, logging should be automatically disabled and re-enabled during upgrades: see [Upgrade should disable logging and triggers](https://issues.civicrm.org/jira/browse/CRM-10798).
  
  This suggests the possibility that if logging remained enabled during an upgrade prior to 4.3.0, the structure of logging tables may not have been updated at that point.
  
  It also suggests that disabling and re-enabling logging ought to bring the logging schema up to date.
  
  
  ---
  
  