File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -164,9 +164,15 @@ public function executeMigrations(string $direction = Direction::UP): void
164164 $ em = $ this ->getContainer ()->get ('doctrine.orm.entity_manager ' );
165165 $ loader = new ExistingEntityManager ($ em );
166166 $ dependencyFactory = DependencyFactory::fromEntityManager ($ confLoader , $ loader );
167+ $ metadataStorage = $ dependencyFactory ->getMetadataStorage ();
167168
168- $ dependencyFactory ->getMetadataStorage ()->ensureInitialized ();
169- $ executed = $ dependencyFactory ->getMetadataStorage ()->getExecutedMigrations ();
169+ try {
170+ $ metadataStorage ->ensureInitialized ();
171+ } catch (\Exception ) {
172+ // table exists
173+ }
174+
175+ $ executed = $ metadataStorage ->getExecutedMigrations ();
170176
171177 if ($ executed ->hasMigration (new Version ($ migrationClass )) && Direction::DOWN !== $ direction ) {
172178 continue ;
You can’t perform that action at this time.
0 commit comments