What is the best way to reset the database along with the migrations.
Here is what I have tried.
- Delete all migrations along with deleting all the database tables. Then running
php bin/console doctrine:mi:diff
php bin/console doctrine:mi:mi
That does not work.
- Try running single version at a time like so
php bin/console doctrine:migrations:migrate 'DoctrineMigrations\Version20200722104913'
- I tried this:
php bin/console doctrine:database:drop --force
php bin/console doctrine:database:create
php bin/console doctrine:mi:mi
The Problem (in detail):
Everything I do leads me to the same result.
Doctrine thinks that I still have some tables to generate which are long gone (Not in the Enitity anymore)
That's why I have this error:
An exception occurred while executing 'DROP TABLE greetings_card_category':
SQLSTATE[42S02]: Base table or view not found: 1051 Unknown table 'symfony.greetings_card_category'
I also get this warning
[WARNING] You have 6 previously executed migrations in the database that are not registered migrations.
In my migrations Directory I only have two migrations:
Version20200722104913.php
Version20200722143619.php
Here is the status if it somehow helps.
bin/console do:mi:status
| Versions | Previous | DoctrineMigrations\Version20200717093052 |
| | Current | DoctrineMigrations\Version20200722150530 |
| | Next | DoctrineMigrations\Version20200722104913 |
| | Latest | DoctrineMigrations\Version20200722143619 |
|--------------------------------------------------------------------------------------------------------
| Migrations | Executed | 6 |
| | Executed Unavailable | 6 |
| | Available | 2 |
| | New | 2
At this point I would really just love to have 1 clean database and 1 migration.
How to achieve this?