'type'=>['description'=>'Type of sitemap this chunk belongs to.','type'=>'varchar','length'=>50,'not null'=>TRUE,'default'=>'',],'delta'=>['description'=>'Delta of the chunk within the type scope.','type'=>'int','not null'=>TRUE,'unsigned'=>TRUE,],

if(!$database->schema()->fieldExists('simple_sitemap','type')){$database->schema()->addField('simple_sitemap','type',['description'=>'Type of sitemap this chunk belongs to.','type'=>'varchar','length'=>50,'not null'=>TRUE,'default'=>'',]);}if(!$database->schema()->fieldExists('simple_sitemap','delta')){$database->schema()->addField('simple_sitemap','delta',['description'=>'Delta of the chunk within the type scope.','type'=>'int','size'=>'small','not null'=>TRUE,'unsigned'=>TRUE,]);}

/** * Removing sitemap types from configuration as they are to be stored as plugins in code. */functionsimple_sitemap_update_8214(){$config_factory=\Drupal::service('config.factory');$sitemap_types=$config_factory->listAll('simple_sitemap.types.');// Remove sitemap type configuration objects.foreach($sitemap_typesas$type){$config_factory->getEditable($type)->delete();}}

/** * Adding 'status' field to simple_sitemap table and weight to variants. */functionsimple_sitemap_update_8215(){$database=\Drupal::database();$database->truncate('simple_sitemap')->execute();if(!$database->schema()->fieldExists('simple_sitemap','status')){$database->schema()->addField('simple_sitemap','status',['description'=>"Flag indicating the publishing status of the chunk.",'type'=>'int','size'=>'tiny','not null'=>TRUE,'unsigned'=>TRUE,'default'=>0,]);}$config_factory=\Drupal::service('config.factory');foreach($config_factory->listAll('simple_sitemap.variants.')as$type){$type=$config_factory->getEditable($type);$variants=$type->get('variants');foreach($variantsas$i=>$variant){$variants[$i]['weight']=0;}$type->set('variants',$variants)->save();}