doctrine:schema:drop --force does not drop the migrations table. This means that you can't do
doctrine:schema:drop --force
doctrine:migrations:migrate
without manually dropping the table. It would be nice if this bundle would automatically drop the migrations table too.
You can drop the database instead of the schema ?
But then you have to run doctrine:database: create before running migrations, so it's an additional command.
This issue is a nice to have by the way. Also it feels kinda inconsistent.
The problem is that the DoctrineBundle doesn't know anything about your migrations table. It's just an additional table not managed by Doctrine. Thus, it will leave the table untouched as it does with any other table not managed by the ORM.
There is a --full-database option in the schema:drop command, allowing to drop tables which are not known by the ORM.
Anyway, the schema:drop command itself is part of the ORM, not of the bundle
My original idea was to create a special case for the DoctrineMigrationsBundle, but the --full-database option works for me. Thanks @stof.
Most helpful comment
There is a
--full-databaseoption in theschema:dropcommand, allowing to drop tables which are not known by the ORM.Anyway, the
schema:dropcommand itself is part of the ORM, not of the bundle