从现有的pre-doctrine数据库创建实体和仓库后,我无法进行初始迁移。它给了我这个错误
非常感谢您的阅读,期待您的见解。
编辑:doctrine_migrations.yaml:
我用来生成实体和仓库的命令如下:
[ERROR] The version "latest" couldn't be reached, there are no registered migrations.
有什么办法可以在不重新开始的情况下进行初始迁移吗?出于某种原因,迁移文件夹存在于src文件夹外面,为什么会这样?在以前的项目中,迁移文件夹在src文件夹内部。非常感谢您的阅读,期待您的见解。
编辑: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'
我用来生成实体和仓库的命令如下:
- php bin/console doctrine:mapping:import "App\Entity" annotation --path=src/Entity
- 在实体.php中修改@ORM\Entity => @ORM\Entity(repositoryClass="App\Repository\UserRepository")
- php bin/console make:entity --regenerate
bin/console doctrine:migrations:migrate
时,出现了错误。
doctrine:migrations:dump-schema
生成初始迁移。但是,对实体的更改未被检测到。 - diggledoot