File tree 1 file changed +8
-2
lines changed
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
164
164
$ em = $ this ->getContainer ()->get ('doctrine.orm.entity_manager ' );
165
165
$ loader = new ExistingEntityManager ($ em );
166
166
$ dependencyFactory = DependencyFactory::fromEntityManager ($ confLoader , $ loader );
167
+ $ metadataStorage = $ dependencyFactory ->getMetadataStorage ();
167
168
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 ();
170
176
171
177
if ($ executed ->hasMigration (new Version ($ migrationClass )) && Direction::DOWN !== $ direction ) {
172
178
continue ;
You can’t perform that action at this time.
0 commit comments