How do I alter a database schema defined from another module? Since hook_schema_alter() was removed from Drupal 8, how do I alter any existing schema defined from another module in Drupal 8?

I have used mymodule_update_8201 (hook_update_N()) in my .install file, but no new field or column gets added into my existing table. Is there any other way to achieve this? 

This is the code for the first module (a.install).

function a_schema() {
  $schema['my_table'] = array(
    'fields' =&gt; array(
       'type' =&gt; array(
          'description' =&gt; 'registration type',
          'type' =&gt; 'varchar',
          'length' =&gt; 255,
        ),
     ),
  );
}


This is the code for the second module (b.install).

/**
 * Implements  hook_update_N().
 */
    function b_update_8201() {
     $spec = array(
        'type' =&gt; 'varchar',
        'description' =&gt; "New Col",
        'length' =&gt; 20,
        'not null' =&gt; FALSE,
      ); 
     $schema = Database::getConnection()-&gt;schema();
     $schema-&gt;addField('my_table', 'newcol', $spec);
     return $schema;
    }
hook_schema_alter() was not used for adding fields to the schema, it was used for reporting alterations to the schema by your module. This was so that functions such as drupal_get_schema() knew the alterations you had made. These functions have all been removed from Drupal 8 however, so there is no need to report your changes in hook_schema_alter().

You can add fields to another schema using:

\Drupal::service('database')-&gt;schema()-&gt;addField()


Documentation: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%21Schema.php/function/Schema%3A%3AaddField/8.2.x