DDC-441: SchemaTool does not handle well removed Entities #552

Closed
opened 2026-01-22 12:42:15 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 18, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user @guilhermeblanco:

When I manually remove an Entity file (in my application: FMM/Entity/FeaturedMap.php) and I attempt to update my schema to apply my changes, I get this:

guilhermeblanco@blanco-asus-laptop:/srv/app/bin$ php ./doctrine.php orm:clear-cache --all
Doctrine Command Line Interface

Clearing all query cache entries.
Orm:clear-cache => No query cache entries found.

Orm:clear-cache (--query | --metadata | --result [--id=<ID>] [--regex=<REGEX>] [--prefix=<PREFIX>] [--suffix=<SUFFIX>])
  Clear cache from configured query, result and metadata drivers.


guilhermeblanco@blanco-asus-laptop:/srv/app/bin$ php ./doctrine.php orm:schema-tool --update --dump-sql --trace
Doctrine Command Line Interface

PHP Warning:  require(FMM/Entity/FeaturedMap.php): failed to open stream: No such file or directory in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145

Warning: require(FMM/Entity/FeaturedMap.php): failed to open stream: No such file or directory in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145
PHP Fatal error:  require(): Failed opening required 'FMM/Entity/FeaturedMap.php' (include_path='/srv/app/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/app/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/app/library:.:/usr/local/lib/php') in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145

Fatal error: require(): Failed opening required 'FMM/Entity/FeaturedMap.php' (include_path='/srv/app/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/geoning/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/app/library:.:/usr/local/lib/php') in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145
Originally created by @doctrinebot on GitHub (Mar 18, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user @guilhermeblanco: When I manually remove an Entity file (in my application: FMM/Entity/FeaturedMap.php) and I attempt to update my schema to apply my changes, I get this: ``` guilhermeblanco@blanco-asus-laptop:/srv/app/bin$ php ./doctrine.php orm:clear-cache --all Doctrine Command Line Interface Clearing all query cache entries. Orm:clear-cache => No query cache entries found. Orm:clear-cache (--query | --metadata | --result [--id=<ID>] [--regex=<REGEX>] [--prefix=<PREFIX>] [--suffix=<SUFFIX>]) Clear cache from configured query, result and metadata drivers. guilhermeblanco@blanco-asus-laptop:/srv/app/bin$ php ./doctrine.php orm:schema-tool --update --dump-sql --trace Doctrine Command Line Interface PHP Warning: require(FMM/Entity/FeaturedMap.php): failed to open stream: No such file or directory in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145 Warning: require(FMM/Entity/FeaturedMap.php): failed to open stream: No such file or directory in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145 PHP Fatal error: require(): Failed opening required 'FMM/Entity/FeaturedMap.php' (include_path='/srv/app/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/app/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/app/library:.:/usr/local/lib/php') in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145 Fatal error: require(): Failed opening required 'FMM/Entity/FeaturedMap.php' (include_path='/srv/app/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/geoning/application/../library:APPLICATION/../library/FMM/Application/Resource:/srv/app/library:.:/usr/local/lib/php') in /srv/app/library/Doctrine/Common/ClassLoader.php on line 145 ```
admin added the Bug label 2026-01-22 12:42:15 +01:00
admin closed this issue 2026-01-22 12:42:15 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 18, 2010):

Comment created by @beberlei:

This cant be right, if you delete the entity and it comes up in the --update there are two reasons for this:

  1. it is still refered to in a releated entity as "targetEntity"
  2. the cache is stale and $em->getMetadataFactory()->getAllClassMetadata() returns the metadata instance of the returned entity.

can you check for both pls? :)

@doctrinebot commented on GitHub (Mar 18, 2010): Comment created by @beberlei: This cant be right, if you delete the entity and it comes up in the --update there are two reasons for this: 1. it is still refered to in a releated entity as "targetEntity" 2. the cache is stale and $em->getMetadataFactory()->getAllClassMetadata() returns the metadata instance of the returned entity. can you check for both pls? :)
Author
Owner

@doctrinebot commented on GitHub (Jan 2, 2011):

Comment created by @guilhermeblanco:

It was invalid... it was still referred by another Entity.

@doctrinebot commented on GitHub (Jan 2, 2011): Comment created by @guilhermeblanco: It was invalid... it was still referred by another Entity.
Author
Owner

@doctrinebot commented on GitHub (Jan 2, 2011):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jan 2, 2011): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#552