diff --git a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
index 282987d..4c34afd 100644
--- a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
+++ b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
@@ -1458,4 +1458,85 @@ static public function _fieldColumnName(FieldInterface $field, $column) {
     return in_array($column, Field::getReservedColumns()) ? $column : $field->getName() . '_' . $column;
   }
 
+  /**
+   * Gets the schema for this entity type.
+   *
+   * @return array|null
+   *   Returns the schema definitions for the entity type's tables. If the
+   *   entity type does not have a schema, returns NULL.
+   */
+  public function getSchema() {
+    $entity_type = $this->entityType();
+    $entity_info = $this->entityInfo();
+
+    $base_table = $entity_info->getBaseTable();
+
+    // If the entity type does not have a base table there is no point in
+    // generating a schema.
+    if (!$base_table) {
+      return;
+    }
+
+    $schema[$base_table]['description'] = "The base table for $entity_type entities.";
+    if ($revision_table = $entity_info->getRevisionTable()) {
+      $schema[$revision_table]['description'] = "The base table for $entity_type revisions.";
+    }
+    if ($data_table = $entity_info->getDataTable()) {
+      $schema[$data_table]['description'] = "The data table for $entity_type entities.";
+    }
+    if ($revision_data_table = $entity_info->getRevisionDataTable()) {
+      $schema[$revision_data_table]['description'] = "The data table for $entity_type revisions.'";
+    }
+
+    $entity_keys = $entity_info->getKeys();
+
+    $class = $this->entityClass;
+    // Invoke ContentEntityInterface::baseFieldDefinitions() directly. Avoid any
+    // info or alter hooks.
+    foreach($class::baseFieldDefinitions($entity_type) as $field_name => $field_definition) {
+      $field_schema = array();
+
+      /** @var \Drupal\Core\Field\FieldDefinitionInterface $field_definition */
+      $definition_schema = $field_definition->getSchema();
+      if (count($definition_schema['columns']) == 1) {
+        $field_schema = reset($definition_schema['columns']);
+      }
+      else {
+        $columns = implode(', ', array_keys($definition_schema['columns']));
+        throw new \Exception("Entity type: $entity_type, Field name: $field_name, Columns: $columns");
+      }
+
+      if ($field_name == $entity_keys['id'] && $field_definition->getType() == 'unsigned_integer') {
+        $field_schema['type'] = 'serial';
+        unset($field_schema['unsigned'], $field_schema['default']);
+
+        $schema[$base_table]['primary key'][] = $field_name;
+      }
+
+      $field_schema['description'] = $field_definition->getDescription();
+
+      // Depending on which tables this entity provides add the appropriate
+      // fields to the appropriate tables:
+      $tables = array();
+      // For entity types without a data table all fields are stored in the base
+      // table. For entity types with a data table only the entity fields
+      // which do not vary by language are stored in the base table.
+      if (!$data_table || in_array($field_name, array_diff_key($entity_keys, array('label' => TRUE)))) {
+        $tables[] = $base_table;
+      }
+
+      foreach ($tables as $table) {
+        $schema[$table]['fields'][$field_name] = $field_schema;
+      }
+
+      // Add indexes.
+      if (!empty($definition_schema['indexes'])) {
+
+      }
+    }
+
+    return $schema;
+  }
+
+
 }
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 ec49cdb..1e084dc 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php
@@ -53,6 +53,7 @@ public static function schema(FieldDefinitionInterface $field_definition) {
         'value' => array(
           'type' => 'int',
           'not null' => TRUE,
+          'default' => 0,
         ),
       ),
     );
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
index 3bae65b..fbb56a2 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
@@ -65,7 +65,8 @@ public static function schema(FieldDefinitionInterface $field_definition) {
         'value' => array(
           'type' => 'varchar',
           'length' => 12,
-          'not null' => FALSE,
+          'not null' => TRUE,
+          'default' => '',
         ),
       ),
     );
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
index ce78a40..e6301b7 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
@@ -56,7 +56,8 @@ public static function schema(FieldDefinitionInterface $field_definition) {
         'value' => array(
           'type' => 'varchar',
           'length' => $field_definition->getSetting('max_length'),
-          'not null' => FALSE,
+          'not null' => TRUE,
+          'default' => '',
         ),
       ),
     );
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php
new file mode 100644
index 0000000..9e22bc6
--- /dev/null
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php
@@ -0,0 +1,66 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Entity\Plugin\Field\FieldType\StringLongItem.
+ */
+
+namespace Drupal\Core\Field\Flugin\Field\FieldType;
+
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemBase;
+use Drupal\Core\TypedData\DataDefinition;
+
+/**
+ * Defines the 'string_long' field type.
+ *
+ * This class cannot extend StringItem because it has differing property
+ * definitions and those are shared among ancestor classes via late static
+ * binding.
+ *
+ * @FieldType(
+ *   id = "string_long",
+ *   label = @Translation("Long string"),
+ *   description = @Translation("An entity field containing a long string value."),
+ *   configurable = FALSE
+ * )
+ */
+class StringLongItem extends FieldItemBase {
+
+  /**
+   * Definitions of the contained properties.
+   *
+   * @see StringItem::getPropertyDefinitions()
+   *
+   * @var array
+   */
+  static $propertyDefinitions;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getPropertyDefinitions() {
+    if (!isset(static::$propertyDefinitions)) {
+      static::$propertyDefinitions['value'] = DataDefinition::create('string_long')
+        ->setLabel(t('Text value'));
+    }
+    return static::$propertyDefinitions;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'text',
+          'size' => 'big',
+          'not null' => TRUE,
+          'default' => '',
+        ),
+      ),
+    );
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UnsignedIntegerItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UnsignedIntegerItem.php
new file mode 100644
index 0000000..c7295c9
--- /dev/null
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UnsignedIntegerItem.php
@@ -0,0 +1,61 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Field\Plugin\Field\FieldType\UnsignedIntegerItem.
+ */
+
+namespace Drupal\Core\Field\Plugin\Field\FieldType;
+
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FieldItemBase;
+use Drupal\Core\TypedData\DataDefinition;
+
+/**
+ * Defines the 'unsigned_integer' field type.
+ *
+ * @FieldType(
+ *   id = "unsigned_integer",
+ *   label = @Translation("Unsigned integer"),
+ *   description = @Translation("An entity field containing an unsigned integer value."),
+ *   configurable = FALSE
+ * )
+ */
+class UnsignedIntegerItem extends FieldItemBase {
+
+  /**
+   * Definitions of the contained properties.
+   *
+   * @see \Drupal\Core\Field\Plugin\Field\FieldType\UnsignedIntegerItem::getPropertyDefinitions()
+   *
+   * @var array
+   */
+  static $propertyDefinitions;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getPropertyDefinitions() {
+    if (!isset(static::$propertyDefinitions)) {
+      static::$propertyDefinitions['value'] = DataDefinition::create('unsigned_integer')
+        ->setLabel(t('Unsigned integer value'));
+    }
+    return static::$propertyDefinitions;
+  }
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'int',
+          'not null' => TRUE,
+          'default' => 0,
+          'unsigned' => TRUE,
+        ),
+      ),
+    );
+  }
+
+}
diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/UnsignedInteger.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/UnsignedInteger.php
new file mode 100644
index 0000000..667e1fb
--- /dev/null
+++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/UnsignedInteger.php
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\TypedData\Plugin\DataType\UnsignedInteger.
+ */
+
+namespace Drupal\Core\TypedData\Plugin\DataType;
+
+/**
+ * The unsigned integer data type.
+ *
+ * The plain value of a unsigned integer is a regular PHP integer that is
+ * positive. For setting the value any PHP variable that casts to a positive
+ * integer may be passed.
+ *
+ * @DataType(
+ *   id = "unsigned_integer",
+ *   label = @Translation("Unsigned integer"),
+ *   constraints = {
+ *     "Range" = {"min" = 0},
+ *   },
+ * )
+ */
+class UnsignedInteger extends Integer {
+}
diff --git a/core/modules/aggregator/aggregator.install b/core/modules/aggregator/aggregator.install
index 23e26c0..7f32129 100644
--- a/core/modules/aggregator/aggregator.install
+++ b/core/modules/aggregator/aggregator.install
@@ -28,7 +28,7 @@ function aggregator_requirements($phase) {
  */
 function aggregator_schema() {
   $schema['aggregator_feed'] = array(
-    'description' => 'Stores feeds to be parsed by the aggregator.',
+    'description' => 'The base table for aggregator_feed entities.',
     'fields' => array(
       'fid' => array(
         'type' => 'serial',
@@ -65,6 +65,7 @@ function aggregator_schema() {
         'not null' => TRUE,
         'default' => 0,
         'description' => 'How often to check for new feed items, in seconds.',
+        'unsigned' => TRUE,
       ),
       'checked' => array(
         'type' => 'int',
@@ -127,7 +128,7 @@ function aggregator_schema() {
   );
 
   $schema['aggregator_item'] = array(
-    'description' => 'Stores the individual items imported from feeds.',
+    'description' => 'The base table for aggregator_item entities.',
     'fields' => array(
       'iid'  => array(
         'type' => 'serial',
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
index ba7c846..1abf115 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php
@@ -116,29 +116,29 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['fid'] = FieldDefinition::create('integer')
+    $fields['fid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Feed ID'))
-      ->setDescription(t('The ID of the aggregator feed.'))
+      ->setDescription(t('Primary Key: Unique feed ID.'))
       ->setReadOnly(TRUE);
 
     $fields['uuid'] = FieldDefinition::create('uuid')
       ->setLabel(t('UUID'))
-      ->setDescription(t('The aggregator feed UUID.'))
+      ->setDescription(t('Unique Key: Universally unique identifier for this entity.'))
       ->setReadOnly(TRUE);
 
     $fields['title'] = FieldDefinition::create('string')
       ->setLabel(t('Title'))
-      ->setDescription(t('The title of the feed.'));
+      ->setDescription(t('Title of the feed.'));
 
     $fields['langcode'] = FieldDefinition::create('language')
       ->setLabel(t('Language code'))
-      ->setDescription(t('The feed language code.'));
+      ->setDescription(t('The {language}.langcode of this feed.'));
 
     $fields['url'] = FieldDefinition::create('uri')
       ->setLabel(t('URL'))
-      ->setDescription(t('The URL to the feed.'));
+      ->setDescription(t('URL to the feed.'));
 
-    $fields['refresh'] = FieldDefinition::create('integer')
+    $fields['refresh'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Refresh'))
       ->setDescription(t('How often to check for new feed items, in seconds.'));
 
@@ -154,11 +154,11 @@ public static function baseFieldDefinitions($entity_type) {
 
     $fields['link'] = FieldDefinition::create('uri')
       ->setLabel(t('Link'))
-      ->setDescription(t('The link of the feed.'));
+      ->setDescription(t('The parent website of the feed; comes from the <link> element in the feed.'));
 
-    $fields['description'] = FieldDefinition::create('string')
+    $fields['description'] = FieldDefinition::create('string_long')
       ->setLabel(t('Description'))
-      ->setDescription(t("The parent website's description that comes from the !description element in the feed.", array('!description' => '<description>')));
+      ->setDescription(t("The parent website's description; comes from the !description element in the feed.", array('!description' => '<description>')));
 
     $fields['image'] = FieldDefinition::create('uri')
       ->setLabel(t('Image'))
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php
index e48e45d9..425a58b 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php
@@ -61,36 +61,36 @@ public function postCreate(EntityStorageControllerInterface $storage_controller)
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['iid'] = FieldDefinition::create('integer')
+    $fields['iid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Aggregator item ID'))
-      ->setDescription(t('The ID of the feed item.'))
+      ->setDescription(t('Primary Key: Unique ID for feed item.'))
       ->setReadOnly(TRUE);
 
     $fields['fid'] = FieldDefinition::create('entity_reference')
       ->setLabel(t('Aggregator feed ID'))
-      ->setDescription(t('The ID of the aggregator feed.'))
+      ->setDescription(t('The {aggregator_feed}.fid to which this item belongs.'))
       ->setSetting('target_type', 'aggregator_feed');
 
     $fields['title'] = FieldDefinition::create('string')
       ->setLabel(t('Title'))
-      ->setDescription(t('The title of the feed item.'));
+      ->setDescription(t('Title of the feed item.'));
 
     $fields['langcode'] = FieldDefinition::create('language')
       ->setLabel(t('Language code'))
-      ->setDescription(t('The feed item language code.'));
+      ->setDescription(t('The {language}.langcode of this feed item.'));
 
     $fields['link'] = FieldDefinition::create('uri')
       ->setLabel(t('Link'))
-      ->setDescription(t('The link of the feed item.'));
+      ->setDescription(t('Link to the feed item.'));
 
     $fields['author'] = FieldDefinition::create('string')
       ->setLabel(t('Author'))
-      ->setDescription(t('The author of the feed item.'));
+      ->setDescription(t('Author of the feed item.'));
 
     // @todo Convert to a text field in https://drupal.org/node/2149845.
     $fields['description'] = FieldDefinition::create('string')
       ->setLabel(t('Description'))
-      ->setDescription(t('The body of the feed item.'));
+      ->setDescription(t('Body of the feed item.'));
 
     // @todo Convert to a "timestamp" field in https://drupal.org/node/2145103.
     $fields['timestamp'] = FieldDefinition::create('integer')
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php
index 643fa33..b6c87e1 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php
@@ -164,7 +164,7 @@ public function delete() {
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['id'] = FieldDefinition::create('integer')
+    $fields['id'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Custom block ID'))
       ->setDescription(t('The custom block ID.'))
       ->setReadOnly(TRUE);
@@ -174,7 +174,7 @@ public static function baseFieldDefinitions($entity_type) {
       ->setDescription(t('The custom block UUID.'))
       ->setReadOnly(TRUE);
 
-    $fields['revision_id'] = FieldDefinition::create('integer')
+    $fields['revision_id'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Revision ID'))
       ->setDescription(t('The revision ID.'))
       ->setReadOnly(TRUE);
diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
index 6bcfd95..62aa58b 100644
--- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
+++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
@@ -353,7 +353,7 @@ public function permalink() {
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['cid'] = FieldDefinition::create('integer')
+    $fields['cid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Comment ID'))
       ->setDescription(t('The comment ID.'))
       ->setReadOnly(TRUE);
@@ -365,12 +365,12 @@ public static function baseFieldDefinitions($entity_type) {
 
     $fields['pid'] = FieldDefinition::create('entity_reference')
       ->setLabel(t('Parent ID'))
-      ->setDescription(t('The parent comment ID if this is a reply to a comment.'))
+      ->setDescription(t('The parent comment ID if this is a reply to a comment, as a Unix timestamp.'))
       ->setSetting('target_type', 'comment');
 
     $fields['entity_id'] = FieldDefinition::create('entity_reference')
       ->setLabel(t('Entity ID'))
-      ->setDescription(t('The ID of the entity of which this comment is a reply.'))
+      ->setDescription(t('The ID of the entity of which this comment is a reply, as a Unix timestamp.'))
       ->setSetting('target_type', 'node')
       ->setRequired(TRUE);
 
diff --git a/core/modules/file/lib/Drupal/file/Entity/File.php b/core/modules/file/lib/Drupal/file/Entity/File.php
index 816435b..2979ad3 100644
--- a/core/modules/file/lib/Drupal/file/Entity/File.php
+++ b/core/modules/file/lib/Drupal/file/Entity/File.php
@@ -225,7 +225,7 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['fid'] = FieldDefinition::create('integer')
+    $fields['fid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('File ID'))
       ->setDescription(t('The file ID.'))
       ->setReadOnly(TRUE);
@@ -256,7 +256,7 @@ public static function baseFieldDefinitions($entity_type) {
       ->setLabel(t('File MIME type'))
       ->setDescription(t("The file's MIME type."));
 
-    $fields['filesize'] = FieldDefinition::create('integer')
+    $fields['filesize'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('File size'))
       ->setDescription(t('The size of the file in bytes.'));
 
diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php
index 0d4683e..e155278 100644
--- a/core/modules/node/lib/Drupal/node/Entity/Node.php
+++ b/core/modules/node/lib/Drupal/node/Entity/Node.php
@@ -344,7 +344,7 @@ public function setRevisionAuthorId($uid) {
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['nid'] = FieldDefinition::create('integer')
+    $fields['nid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Node ID'))
       ->setDescription(t('The node ID.'))
       ->setReadOnly(TRUE);
@@ -354,7 +354,7 @@ public static function baseFieldDefinitions($entity_type) {
       ->setDescription(t('The node UUID.'))
       ->setReadOnly(TRUE);
 
-    $fields['vid'] = FieldDefinition::create('integer')
+    $fields['vid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Revision ID'))
       ->setDescription(t('The node revision ID.'))
       ->setReadOnly(TRUE);
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php
index 59f8287..762ea0e 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php
@@ -134,7 +134,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) {
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['id'] = FieldDefinition::create('integer')
+    $fields['id'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('ID'))
       ->setDescription(t('The ID of the shortcut.'))
       ->setReadOnly(TRUE);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
index f97a44f..7804da8 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
@@ -236,6 +236,7 @@ function testEntityQuery() {
     // word but allows us to test revisions and string operations.
     $ids = $this->factory->get('entity_test_mulrev')
       ->condition("$greetings.value", 'merhaba')
+      ->sort('id')
       ->execute();
     $entities = entity_load_multiple('entity_test_mulrev', $ids);
     foreach ($entities as $entity) {
@@ -268,12 +269,14 @@ function testEntityQuery() {
     $this->assertIdentical($results, $assert);
     $results = $this->factory->get('entity_test_mulrev')
       ->condition("$greetings.value", 'siema', 'STARTS_WITH')
+      ->sort('revision_id')
       ->execute();
     // Now we only get the ones that originally were siema, entity id 8 and
     // above.
     $this->assertIdentical($results, array_slice($assert, 4, 8, TRUE));
     $results = $this->factory->get('entity_test_mulrev')
       ->condition("$greetings.value", 'a', 'ENDS_WITH')
+      ->sort('revision_id')
       ->execute();
     // It is very important that we do not get the ones which only have
     // xsiemax despite originally they were merhaba, ie. ended with a.
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
index 9798c4f..8686cfd 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php
@@ -124,7 +124,7 @@ public function label() {
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['id'] = FieldDefinition::create('integer')
+    $fields['id'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('ID'))
       ->setDescription(t('The ID of the test entity.'))
       ->setReadOnly(TRUE);
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php
index e0dce68..3886440 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php
@@ -50,7 +50,7 @@ class EntityTestMulRev extends EntityTestRev {
   public static function baseFieldDefinitions($entity_type) {
     $fields = parent::baseFieldDefinitions($entity_type);
 
-    $fields['revision_id'] = FieldDefinition::create('integer')
+    $fields['revision_id'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Revision ID'))
       ->setDescription(t('The version id of the test entity.'))
       ->setReadOnly(TRUE);
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php
index a31dcdc..84f7471 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php
@@ -69,7 +69,7 @@ public function getRevisionId() {
   public static function baseFieldDefinitions($entity_type) {
     $fields = parent::baseFieldDefinitions($entity_type);
 
-    $fields['revision_id'] = FieldDefinition::create('integer')
+    $fields['revision_id'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Revision ID'))
       ->setDescription(t('The version id of the test entity.'))
       ->setReadOnly(TRUE);
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php
index b28a6d9..7898d2f 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php
@@ -197,7 +197,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['tid'] = FieldDefinition::create('integer')
+    $fields['tid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Term ID'))
       ->setDescription(t('The term ID.'))
       ->setReadOnly(TRUE);
@@ -229,7 +229,7 @@ public static function baseFieldDefinitions($entity_type) {
       ->setDescription(t('The weight of this term in relation to other terms.'))
       ->setSetting('default_value', 0);
 
-    $fields['parent'] = FieldDefinition::create('integer')
+    $fields['parent'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('Term Parents'))
       ->setDescription(t('The parents of this term.'))
       // Save new terms with no parents by default.
diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextFormattedItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextFormattedItem.php
new file mode 100644
index 0000000..6049b7a
--- /dev/null
+++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextFormattedItem.php
@@ -0,0 +1,70 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\text\Plugin\Field\FieldType\TextLongItem.
+ */
+
+namespace Drupal\text\Plugin\Field\FieldType;
+
+use Drupal\Core\Field\FieldDefinitionInterface;
+
+/**
+ * Plugin implementation of the 'text_formatted' field type.
+ *
+ * @FieldType(
+ *   id = "text_formatted",
+ *   label = @Translation("Long text"),
+ *   description = @Translation("This field stores long text in the database."),
+ *   instance_settings = {
+ *     "text_processing" = "0"
+ *   },
+ *   default_widget = "text_textarea",
+ *   default_formatter = "text_default"
+ * )
+ */
+class TextFormattedItem extends TextItemBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'text',
+          'size' => 'big',
+          'not null' => FALSE,
+        ),
+        'format' => array(
+          'type' => 'varchar',
+          'length' => 255,
+          'not null' => FALSE,
+        ),
+      ),
+      'indexes' => array(
+        'format' => array('format'),
+      ),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function instanceSettingsForm(array $form, array &$form_state) {
+    $element = array();
+
+    $element['text_processing'] = array(
+      '#type' => 'radios',
+      '#title' => t('Text processing'),
+      '#default_value' => $this->getFieldSetting('text_processing'),
+      '#options' => array(
+        t('Plain text'),
+        t('Filtered text (user selects text format)'),
+      ),
+    );
+
+    return $element;
+  }
+
+}
diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php
index 7e378fc..6049b7a 100644
--- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php
+++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php
@@ -10,10 +10,10 @@
 use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
- * Plugin implementation of the 'text_long' field type.
+ * Plugin implementation of the 'text_formatted' field type.
  *
  * @FieldType(
- *   id = "text_long",
+ *   id = "text_formatted",
  *   label = @Translation("Long text"),
  *   description = @Translation("This field stores long text in the database."),
  *   instance_settings = {
@@ -23,7 +23,7 @@
  *   default_formatter = "text_default"
  * )
  */
-class TextLongItem extends TextItemBase {
+class TextFormattedItem extends TextItemBase {
 
   /**
    * {@inheritdoc}
diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php
index 2954df5..c29b53d 100644
--- a/core/modules/user/lib/Drupal/user/Entity/User.php
+++ b/core/modules/user/lib/Drupal/user/Entity/User.php
@@ -423,7 +423,7 @@ public function setUsername($username) {
    * {@inheritdoc}
    */
   public static function baseFieldDefinitions($entity_type) {
-    $fields['uid'] = FieldDefinition::create('integer')
+    $fields['uid'] = FieldDefinition::create('unsigned_integer')
       ->setLabel(t('User ID'))
       ->setDescription(t('The user ID.'))
       ->setReadOnly(TRUE);
