Answers.Body: <p>I think this may be a bug in the CiviCRM update process. It is trying to add the <code>entity_modified_date</code> before this column is created.</p>
  <p>I've raised an issue in <a href="https://lab.civicrm.org/dev/core/-/issues/3045" rel="nofollow noreferrer">https://lab.civicrm.org/dev/core/-/issues/3045</a></p>
  <p>A <a href="https://github.com/civicrm/civicrm-core/pull/22643" rel="nofollow noreferrer">patch is available</a> which fixed the issue for me. You could try applying this to your site to see if that works for you too.</p>
  <p>Alternatively, you could try upgrading to CiviCRM 5.44 then upgrading to CiviCRM 5.45 (this also solved the issue for me).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-02T14:05:40.397Z
Answers.Text: It actually helped to do the update to 5.44.0 first and after that the update to 5.45. Thank you!!!
Answers.UserDisplayName: Tobias Krause
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-02T14:08:28.923Z
Answers.Text: @TobiasKrause I'm glad that helped!
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-27T09:28:05.587Z
Answers.LastActivityDate: 2022-01-31T12:09:42.610Z
Answers.LastEditDate: 2022-01-31T12:09:42.610Z
Answers.UserDisplayName: William Mortada
Body: <p>CiviCRM is currently running on version 5.42.1. I wanted to upgrade to 5.45.0 but here the upgrade script fails with following message:</p>
  <pre><code>[callback] =&gt; Array
      (
          [0] =&gt; CRM_Core_Error
          [1] =&gt; exceptionHandler
      )
  
  [code] =&gt; -19
  [message] =&gt; DB Error: no such field
  [mode] =&gt; 16
  [debug_info] =&gt; UPDATE  `civicrm_managed`  SET `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` =
  'ReportTemplate' , `entity_id` = 1099 , `entity_modified_date` = NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in
  'field list']
      [type] =&gt; DB_Error
      [user_info] =&gt; UPDATE  `civicrm_managed`  SET `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` = 'ReportTemplate'
      , `entity_id` = 1099 , `entity_modified_date` = NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in 'field list']
          [to_string] =&gt; [db_error: message=&quot;DB Error: no such field&quot; code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=&quot;&quot; info=&quot;UPDATE  `civicrm_managed`  SET
      `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` = 'ReportTemplate' , `entity_id` = 1099 , `entity_modified_date` =
      NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in 'field list']&quot;]
  </code></pre>
  <p>I found out that this field is added in CRM_Upgrade_Incremental_php_FiveFortyFive-&gt;upgrade_5_45_alpha1() (as far as I understand). May this be a conflict with the order of creating the field in table and updating the data in table later on?</p>
  <p>By now only content from Extended Report plugin is in this civicrm_managed table. I don't know what the purpose of this table is in general but maybe this is the reason why this issue did not appear for others but for me as I have this more or less exotic plugin installed?!</p>
  
Tags: <extension><upgrade>
Title: Upgrade fails: Unknown column 'entity_modified_date'
ThreadText: # Upgrade fails: Unknown column 'entity_modified_date'
  
  (Asked by: username_0 on 2022-01-12)
  
  CiviCRM is currently running on version 5.42.1. I wanted to upgrade to 5.45.0 but here the upgrade script fails with following message:
  [callback] => Array
      (
          [0] => CRM_Core_Error
          [1] => exceptionHandler
      )
  
  [code] => -19
  [message] => DB Error: no such field
  [mode] => 16
  [debug_info] => UPDATE  `civicrm_managed`  SET `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` =
  'ReportTemplate' , `entity_id` = 1099 , `entity_modified_date` = NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in
  'field list']
      [type] => DB_Error
      [user_info] => UPDATE  `civicrm_managed`  SET `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` = 'ReportTemplate'
      , `entity_id` = 1099 , `entity_modified_date` = NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in 'field list']
          [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="UPDATE  `civicrm_managed`  SET
      `module` = 'nz.co.fuzion.extendedreport' , `name` = 'Extended Report - Editable Activities' , `entity_type` = 'ReportTemplate' , `entity_id` = 1099 , `entity_modified_date` =
      NULL   WHERE (  `civicrm_managed`.`id` = 54 )   [nativecode=1054 ** Unknown column 'entity_modified_date' in 'field list']"]
  
  I found out that this field is added in CRM_Upgrade_Incremental_php_FiveFortyFive->upgrade_5_45_alpha1() (as far as I understand). May this be a conflict with the order of creating the field in table and updating the data in table later on?
  By now only content from Extended Report plugin is in this civicrm_managed table. I don't know what the purpose of this table is in general but maybe this is the reason why this issue did not appear for others but for me as I have this more or less exotic plugin installed?!
  
  **Tags:** extension, upgrade
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-01-27. Score: 2 | Accepted answer
  
  I think this may be a bug in the CiviCRM update process. It is trying to add the `entity_modified_date` before this column is created.
  
  I've raised an issue in <https://lab.civicrm.org/dev/core/-/issues/3045>
  
  A [patch is available](https://github.com/civicrm/civicrm-core/pull/22643) which fixed the issue for me. You could try applying this to your site to see if that works for you too.
  
  Alternatively, you could try upgrading to CiviCRM 5.44 then upgrading to CiviCRM 5.45 (this also solved the issue for me).
  
  > **Comments:**
  > **username_0**: It actually helped to do the update to 5.44.0 first and after that the update to 5.45. Thank you!!!  
  > **username_1**: @TobiasKrause I'm glad that helped!  
  
  ---
  
  