diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php index 2bafa8b..0d52aa8 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php @@ -41,6 +41,7 @@ public static function defaultInstanceSettings() { 'max' => '', 'prefix' => '', 'suffix' => '', + 'size' => NULL, ) + parent::defaultInstanceSettings(); } @@ -91,6 +92,9 @@ public static function schema(FieldStorageDefinitionInterface $field_definition) 'not null' => FALSE, // Expose the 'unsigned' setting in the field item schema. 'unsigned' => $field_definition->getSetting('unsigned'), + // Expose the 'size' setting in the field item schema. For instance, + // supply 'big' as a value to produce a 'bigint' type. + 'size' => $field_definition->getSetting('size'), ), ), ); diff --git a/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php b/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php index 5b67329..75c52f7 100644 --- a/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/Schema/ContentEntitySchemaHandlerTest.php @@ -17,6 +17,7 @@ * @coversDefaultClass \Drupal\Core\Entity\Schema\ContentEntitySchemaHandler * * @group Drupal + * @group ponies * @group Entity */ class ContentEntitySchemaHandlerTest extends UnitTestCase { @@ -250,57 +251,46 @@ public function testGetSchemaBase($uuid_key) { 'description' => 'The name field.', 'type' => 'varchar', 'length' => 255, - 'not null' => FALSE, ), 'description__value' => array( 'description' => 'The description field.', 'type' => 'text', - 'not null' => FALSE, ), 'description__format' => array( 'description' => 'The description field.', 'type' => 'varchar', - 'not null' => FALSE, ), 'owner' => array( 'description' => 'The owner field.', 'type' => 'int', - 'not null' => FALSE, ), 'translator' => array( 'description' => 'The translator field.', 'type' => 'int', - 'not null' => FALSE, ), 'location__country' => array( 'description' => 'The location field.', 'type' => 'varchar', - 'not null' => FALSE, ), 'location__state' => array( 'description' => 'The location field.', 'type' => 'varchar', - 'not null' => FALSE, ), 'location__city' => array( 'description' => 'The location field.', 'type' => 'varchar', - 'not null' => FALSE, ), 'editor' => array( 'description' => 'The editor field.', 'type' => 'int', - 'not null' => FALSE, ), 'editor_revision__target_id' => array( 'description' => 'The editor_revision field.', 'type' => 'int', - 'not null' => FALSE, ), 'editor_revision__target_revision_id' => array( 'description' => 'The editor_revision field.', 'type' => 'int', - 'not null' => FALSE, ), 'default_langcode' => array( 'description' => 'Boolean indicating whether field values are in the default entity language.', @@ -418,7 +408,6 @@ public function testGetSchemaRevisionable() { 'revision_id' => array( 'description' => 'The revision_id field.', 'type' => 'int', - 'not null' => FALSE, ) ), 'primary key' => array('id'), @@ -444,7 +433,6 @@ public function testGetSchemaRevisionable() { 'revision_id' => array( 'description' => 'The revision_id field.', 'type' => 'serial', - 'not null' => FALSE, ), ), 'primary key' => array('revision_id'), @@ -623,7 +611,6 @@ public function testGetSchemaRevisionableTranslatable() { 'revision_id' => array( 'description' => 'The revision_id field.', 'type' => 'int', - 'not null' => FALSE, ), 'langcode' => array( 'description' => 'The langcode field.', @@ -654,7 +641,6 @@ public function testGetSchemaRevisionableTranslatable() { 'revision_id' => array( 'description' => 'The revision_id field.', 'type' => 'serial', - 'not null' => FALSE, ), 'langcode' => array( 'description' => 'The langcode field.', @@ -684,7 +670,6 @@ public function testGetSchemaRevisionableTranslatable() { 'revision_id' => array( 'description' => 'The revision_id field.', 'type' => 'int', - 'not null' => FALSE, ), 'langcode' => array( 'description' => 'The langcode field.', @@ -714,7 +699,6 @@ public function testGetSchemaRevisionableTranslatable() { 'revision_id' => array( 'description' => 'The revision_id field.', 'type' => 'int', - 'not null' => FALSE, ), 'langcode' => array( 'description' => 'The langcode field.',