![](/img/trans.png)
[英]How to change or to remove an entity/table created by Doctrine2 in Symfony2?
[英]How to remove an entity class from a Symfony2 + Doctrine2 project?
我的情況是這樣的:
當我開始我的項目時,我將一個類命名為“ Propietario”,將我的應用程序部署到生產服務器,並很快意識到該名稱是不熟練的,所以我將其重命名為“ Cliente”。
我在開發環境中進行了所有替換,測試了該應用程序,並且工作正常。
現在,當我將其部署到產品(清除緩存和東西)時,出現以下錯誤:
[2017-04-20 10:30:30] request.CRITICAL: Uncaught PHP Exception ReflectionException: "Class AppBundle\Entity\Propietario does not exist" at /usr/share/nginx/mecanicos/var/cache/prod/classes.php line 9374 {"exception":"[object] (ReflectionException(code: -1): Class AppBundle\\Entity\\Propietario does not exist at /usr/share/nginx/mecanicos/var/cache/prod/classes.php:9374)"} []
[2017-04-20 10:30:30] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []
我不明白為什么它仍在尋找以前的類名(哪個已經不存在了……我想某個地方必須有對它的引用,但我找不到它)。
謝謝
在您的Symfony項目文件夾中運行以下命令:
php bin/console cache:clear --env=prod
如果這樣不起作用,請刪除var/cache
文件夾。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.