/**
* Add new table for karma.
*/
function MYMODULE_update_10001() {
$database = \Drupal::database();
$schema = $database->schema();
$table_name = 'my_rate_karma';
$table_schema = [
'description' => '{my_rate_karma} holds user karma.',
'fields' => [
'uid' => [
'description' => 'ID of the user',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
],
'karma' => [
'description' => 'Karma value of the user',
'type' => 'int',
],
],
'primary key' => ['uid'],
];
$schema?->createTable($table_name, $table_schema);
}