Doctrinebundle: DoctrineMigrationsBundle and doctrine:schema:drop --force

Created on 21 Nov 2016  路  5Comments  路  Source: doctrine/DoctrineBundle

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.

Most helpful comment

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

All 5 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmaicher picture dmaicher  路  4Comments

KartaviK picture KartaviK  路  4Comments

onavascuez picture onavascuez  路  4Comments

alcaeus picture alcaeus  路  4Comments

peter-gribanov picture peter-gribanov  路  7Comments