You are here

function update_system_schema_requirements in Drupal 10

Same name and namespace in other branches
  1. 8 core/includes/update.inc \update_system_schema_requirements()
  2. 9 core/includes/update.inc \update_system_schema_requirements()

Returns whether the minimum schema requirement has been satisfied.

Return value

array A requirements info array.

1 call to update_system_schema_requirements()
update_check_requirements in core/includes/update.inc
Checks update requirements and reports errors and (optionally) warnings.

File

core/includes/update.inc, line 21
Drupal database update API.

Code

function update_system_schema_requirements() {
  $requirements = [];
  $system_schema = \Drupal::service('update.update_hook_registry')
    ->getInstalledVersion('system');
  $requirements['minimum schema']['title'] = 'Minimum schema version';
  if ($system_schema >= \Drupal::CORE_MINIMUM_SCHEMA_VERSION) {
    $requirements['minimum schema'] += [
      'value' => 'The installed schema version meets the minimum.',
      'description' => 'Schema version: ' . $system_schema,
    ];
  }
  else {
    $requirements['minimum schema'] += [
      'value' => 'The installed schema version does not meet the minimum.',
      'severity' => REQUIREMENT_ERROR,
      'description' => 'Your system schema version is ' . $system_schema . '. Updating directly from a schema version prior to 8000 is not supported. You must upgrade your site to Drupal 8 first, see https://www.drupal.org/docs/8/upgrade.',
    ];
  }
  return $requirements;
}