Doctrinebundle: Adding doctrine:database:purge/truncate functionality

Created on 2 Dec 2015  路  1Comment  路  Source: doctrine/DoctrineBundle

I find strange that there is not such an option. Yes, you can use

$ php bin/console doctrine:database:drop --force
$ php bin/console doctrine:database:create
$ php bin/console doctrine:schema:update

But in some environments you just don't have the option (or permission) to create databases, even if you can do as you wish with your currently created database.

Actually, this _purge method_ seems to be implemented as part of doctrine:fixture:load and I've found myself creating empty fixtures as a quick easy _kinda dirty_ workaround to purge databases before re-initializing them (granted, doesn't reset the index auto-increment counters, but for some use cases that's not a big deal).

>All comments

Closing for now.

Was this page helpful?
0 / 5 - 0 ratings