Last active
February 23, 2016 18:04
-
-
Save achristodoulou/48c5206c59f6c168f427 to your computer and use it in GitHub Desktop.
When you are writing your first migration many changes are made and this script can drop and recreate the schema
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rm -f src/AppBundle/Migrations/*.php && | |
| php bin/console doctrine:database:drop --force && | |
| php bin/console doctrine:database:create && | |
| php bin/console doctrine:migrations:diff && | |
| php bin/console doctrine:migrations:migrate --no-interaction && | |
| php bin/console doctrine:fixtures:load --no-interaction |
Symfony 3 (use existing migrations)
php bin/console doctrine:database:drop --force &&
php bin/console doctrine:database:create &&
php bin/console doctrine:migrations:migrate --no-interaction &&
php bin/console doctrine:fixtures:load --no-interaction
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[Symfony >2.8]
rm -f src/AppBundle/Migrations/*.php &&
php app/console doctrine:database:drop --force &&
php app/console doctrine:database:create &&
php app/console doctrine:migrations:diff &&
php app/console doctrine:migrations:migrate --no-interaction &&
php app/console doctrine:fixtures:load --no-interaction