After creating an Entity and Repository from an existing pre-doctrine database, I am unable to make an initial migration. It gave me this error [ERROR] The version "latest" couldn't be reached, there are no registered migrations.
Any idea how to do an initial migration without starting fresh? And for some reason, the migration folder exists outside the src folder, why is it so? In a previous project, the migration folder exists inside the src folder.
Any insight would be appreciated. Thank you for reading.
EDIT: doctrine_migrations.yaml:
doctrine_migrations:
migrations_paths:
# namespace is arbitrary but should be different from App\Migrations
# as migrations classes should NOT be autoloaded
'DoctrineMigrations': '%kernel.project_dir%/migrations'
The commands I used to generate the Entity and its Repository is as follows:
- php bin/console doctrine:mapping:import "App\Entity" annotation --path=src/Entity
- modified the @ORM\Entity => @ORM\Entity(repositoryClass="App\Repository\UserRepository") in the entity .php
- php bin/console make:entity --regenerate
Then when I run bin/console doctrine:migrations:migrate
, the error pops up.
doctrine:migrations:dump-schema
. However, changes to the entity are not detected. – cswannabe