Problem/Motivation
In #2705389: All content entities should extend RevisionableContentEntityBase we want to enable revisions everywhere. But in order for this to be committed in 8.x we need a data upgrade/migration path.
What currently stops us is the fact that we need to change the entity type definition to enable revisions. Why is this a problem? That's because in \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::onEntityTypeUpdate
we throw a EntityStorageException
if \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::requiresEntityDataMigration
returns true (which it will for existing sites).
Proposed resolution
A service that can be called from within an update hook.
Pass in the entity type object and it will create / remove tables and columns, update the installed entity and field definition, and migrate and data.
This issue will also add tests for the service to test switching an entity_test entity from non-revisionable to revisionable.