0

I need to update a default value of column

/**
  * {@inheritdoc}
  */
public static function schema(FieldStorageDefinitionInterface $field_definition) {
  return [
    'columns' => [
      'status' => [
        'description' => 'Whether reactions are allowed on this entity: 0 = no, 1 = closed (read only), 2 = open (read/write).',
        'type' => 'int',
        'default' => 0, // <-- HERE
      ],
    ],
    'indexes' => [],
    'foreign keys' => [],
  ];
}

When I changed from 0 to 2 I get error on status report page about "field definitions mismatch"

There are a lot of questions about adding and removing columns. Here for example, but I don't understand how to update schema PROGRAMMATICALLY without adding or removing column

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.