Deleting table using Doctrine2 and Symfony2

前端 未结 4 1843
悲哀的现实
悲哀的现实 2021-01-05 19:04

How can I delete table using Doctrine2 and Symfony2? I\'ve generated entities and updated schema, now I want to delete this structure.

4条回答
  •  抹茶落季
    2021-01-05 19:34

    In Doctrine 2.6.2 you can DROP table by deleting entity class, after migrations:diff you will get new file with DROP TABLE query, migrations:migrate will execute the command dropping desired table. Class that was about to get deleted had relationships with other entities, so I had to brutally (manually) delete all mentions of old entity class in other entities. Just tested.

提交回复
热议问题