diff --git a/CRM/Upgrade/Incremental/php/FiveFourteen.php b/CRM/Upgrade/Incremental/php/FiveFourteen.php
index ad58a8a853ced0039ad7942ef70acc4ceca65230..97bca1d3700aec8132c7f742f793d529e6ac5135 100644
--- a/CRM/Upgrade/Incremental/php/FiveFourteen.php
+++ b/CRM/Upgrade/Incremental/php/FiveFourteen.php
@@ -67,21 +67,40 @@ class CRM_Upgrade_Incremental_php_FiveFourteen extends CRM_Upgrade_Incremental_B
    * (change the x in the function name):
    */
 
-  //  /**
-  //   * Upgrade function.
-  //   *
-  //   * @param string $rev
-  //   */
-  //  public function upgrade_5_0_x($rev) {
-  //    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
-  //    $this->addTask('Do the foo change', 'taskFoo', ...);
-  //    // Additional tasks here...
-  //    // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
-  //    // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
-  //  }
+  /**
+   * Upgrade function.
+   *
+   * @param string $rev
+   */
+  public function upgrade_5_14_alpha1($rev) {
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
+
+    // Only need to rebuild view if CiviCase is enabled: otherwise will be
+    // rebuilt when component is enabled
+    $config = CRM_Core_Config::singleton();
+    if (in_array('CiviCase', $config->enableComponents)) {
+      $this->addTask('Rebuild case activity views', 'rebuildCaseActivityView', $rev);
+    }
+    // Additional tasks here...
+    // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
+    // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
+  }
 
-  // public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
-  //   return TRUE;
-  // }
+  /**
+   * Rebuild the view of recent and upcoming case activities
+   *
+   * See https://github.com/civicrm/civicrm-core/pull/14086 and
+   * https://lab.civicrm.org/dev/core/issues/832
+   *
+   * @param CRM_Queue_TaskContext $ctx
+   * @return bool
+   */
+  public static function rebuildCaseActivityView($ctx) {
+    if (!CRM_Case_BAO_Case::createCaseViews()) {
+      CRM_Core_Error::debug_log_message(ts("Could not create the MySQL views for CiviCase. Your mysql user needs to have the 'CREATE VIEW' permission"));
+      return FALSE;
+    }
+    return TRUE;
+  }
 
 }