2 // @codingStandardsIgnoreFile
4 use Drupal\Core\Database\Database;
6 $connection = Database::getConnection();
8 // Simulate an entity type that had previously set an initial key schema for a
10 $schema = $connection->select('key_value')
11 ->fields('key_value', ['value'])
12 ->condition('collection', 'entity.storage_schema.sql')
13 ->condition('name', 'entity_test_update.field_schema_data.name')
17 $schema = unserialize($schema);
18 $schema['entity_test_update']['fields']['name']['initial'] = 'test';
20 $connection->update('key_value')
21 ->fields(['value' => serialize($schema)])
22 ->condition('collection', 'entity.storage_schema.sql')
23 ->condition('name', 'entity_test_update.field_schema_data.name')