You are here

function fraction_alter_denominator_helper in Fraction 8

Same name and namespace in other branches
  1. 2.x fraction.post_update.php \fraction_alter_denominator_helper()

Helper function that updates the field schema for denominator.

Parameters

string $table_name: The database table name.

string $column_name: The database column name.

1 call to fraction_alter_denominator_helper()
fraction_post_update_make_denominator_signed in ./fraction.post_update.php
Alter schema to make denominator signed.

File

./fraction.post_update.php, line 88
Post update functions for Fraction.

Code

function fraction_alter_denominator_helper($table_name, $column_name) {
  \Drupal::database()
    ->schema()
    ->changeField($table_name, $column_name, $column_name, [
    'description' => 'Fraction denominator value',
    'type' => 'int',
    'not null' => TRUE,
    'default' => 1,
  ]);
}