Mercurial > hg > isophonics-drupal-site
comparison core/modules/system/tests/fixtures/update/drupal-8.entity-test-initial.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
1 <?php | |
2 // @codingStandardsIgnoreFile | |
3 | |
4 use Drupal\Core\Database\Database; | |
5 | |
6 $connection = Database::getConnection(); | |
7 | |
8 // Simulate an entity type that had previously set an initial key schema for a | |
9 // field. | |
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') | |
14 ->execute() | |
15 ->fetchField(); | |
16 | |
17 $schema = unserialize($schema); | |
18 $schema['entity_test_update']['fields']['name']['initial'] = 'test'; | |
19 | |
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') | |
24 ->execute(); |