Handle MySQL enum types in an existing DB schema
This commit is contained in:
parent
18ba59e4dd
commit
6d4e3391f4
@ -102,6 +102,12 @@ class ActivityPub
|
||||
public function updateSchema()
|
||||
{
|
||||
$entityManager = @$this->module->get( EntityManager::class );
|
||||
$driverName = $entityManager->getConnection()->getDriver()->getName();
|
||||
if ( $driverName === 'pdo_mysql' )
|
||||
{
|
||||
$entityManager->getConnection()->getDatabasePlatform()
|
||||
->registerDoctrineTypeMapping('enum', 'string');
|
||||
}
|
||||
$schemaTool = new SchemaTool( $entityManager );
|
||||
$classes = $entityManager->getMetadataFactory()->getAllMetadata();
|
||||
$schemaTool->updateSchema( $classes, true );
|
||||
|
Loading…
Reference in New Issue
Block a user