You are here

function patchinfo_update_8202 in PatchInfo 8.2

Adds source field to patchinfo database table.

File

./patchinfo.install, line 90
Install, update, and uninstall functions for the Patch Info module.

Code

function patchinfo_update_8202() {
  $table = 'patchinfo';
  $field = 'source';
  $spec = [
    'description' => 'Source information',
    'type' => 'text',
    'not null' => TRUE,
    'initial' => '',
  ];
  $schema = Database::getConnection()
    ->schema();
  if ($schema) {
    if ($schema
      ->tableExists($table)) {
      if (!$schema
        ->fieldExists($table, $field)) {
        $schema
          ->addField($table, $field, $spec);
      }
    }
  }
}