Answers.Body: <p>Start by checking that the <code>civicrm_activity</code> table does have a <code>created_date</code> column.  If not, maybe something went wrong with the upgrade process - which is a bigger issue.</p>
  
  <p>If it does exist, do you have logging enabled?  When you change <code>civicrm_activity</code>, a trigger will update the related <code>log_civicrm_activity</code> table and if that does not have <code>created_date</code> then the original action will fail.  If that is case, you can disable and then re-enable logging at <code>Administer &gt; System Settings &gt; Misc</code> which should fix the problem. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T15:44:19.517Z
Answers.Text: Thanks Aidan. Turning off logging solved the problem. It seems like the created_date column had been created ok for the main civicrm_activity table but not for the log_civicrm_activity table. When I tried to re-enable logging, it gave this error (so I'm just going to leave logging off for now):
  
  [nativecode=1194 ** Table 'log_civicrm_activity' is marked as crashed and should be repaired]
Answers.UserDisplayName: Stuart Parker
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-17T12:55:43.747Z
Answers.LastActivityDate: 2017-10-17T12:55:43.747Z
Answers.UserDisplayName: Aidan
Body: <p>Now that Civi version 4.7.25 has introduced creation_date for activities, I am having SQL errors when I try to create a new activity or delete a recent activity, which results in fatal errors:</p>
  
  <blockquote>
    <p>Unknown column 'created_date' in 'field list'</p>
  </blockquote>
  
  <p>I can't replicate this in the CiviCRM sandbox (<a href="http://dmaster.demo.civicrm.org/civicrm/" rel="nofollow noreferrer">http://dmaster.demo.civicrm.org/civicrm/</a>), although that is running Civi 4.7.28.</p>
  
  <p>If I run the SQL command in phpmyadmin, then it gives the same error, so I guess there's some problem with the table civicrm_activity since updating to 4.7.25</p>
  
  <p>Any ideas?</p>
  
Tags: <activities>
Title: SQL error trying to delete activities following CRM-20958
ThreadText: # SQL error trying to delete activities following CRM-20958
  
  (Asked by: username_0 on 2017-10-17)
  
  Now that Civi version 4.7.25 has introduced creation\_date for activities, I am having SQL errors when I try to create a new activity or delete a recent activity, which results in fatal errors:
  
  > Unknown column 'created\_date' in 'field list'
  
  I can't replicate this in the CiviCRM sandbox (<http://dmaster.demo.civicrm.org/civicrm/>), although that is running Civi 4.7.28.
  
  If I run the SQL command in phpmyadmin, then it gives the same error, so I guess there's some problem with the table civicrm\_activity since updating to 4.7.25
  
  Any ideas?
  
  **Tags:** activities
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-10-17. Score: 2 | Accepted answer
  
  Start by checking that the `civicrm_activity` table does have a `created_date` column. If not, maybe something went wrong with the upgrade process - which is a bigger issue.
  
  If it does exist, do you have logging enabled? When you change `civicrm_activity`, a trigger will update the related `log_civicrm_activity` table and if that does not have `created_date` then the original action will fail. If that is case, you can disable and then re-enable logging at `Administer > System Settings > Misc` which should fix the problem.
  
  > **Comments:**
  > **username_0**: Thanks username_1. Turning off logging solved the problem. It seems like the created_date column had been created ok for the main civicrm_activity table but not for the log_civicrm_activity table. When I tried to re-enable logging, it gave this error (so I'm just going to leave logging off for now):  [nativecode=1194 ** Table 'log_civicrm_activity' is marked as crashed and should be repaired]  
  
  ---
  
  