Problem/Motivation
We decided in #2976035-13: [PP-1] Entity type CRUD operations must use the last installed entity type and field storage definitions to drop support for automatic entity updates, for the many reasons stated in that comment.
However, we can add support for changing the entity schema to (non-)revisionable/(non-)translatable by using "manual" entity updates (i.e. explicit update functions), which should work for entity type with and without data.
Proposed resolution
Generalize and improve the code in \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchemaConverter
to not use the live entity type and field storage definitions anymore, and make it work as part of SqlContentEntityStorageSchema
instead of trying to work around/against it.
Remaining tasks
Review the proposed solution.
User interface changes
Nope.
API changes
API addition: a new updateEntityTypeSchema(EntityTypeInterface $entity_type, array $field_storage_definitions, array &$sandbox = NULL)
method added to EntityDefinitionUpdateManager
.
Data model changes
Nope.